God and the priests
All submissions for this problem are available.
God passed down the knowledge of him to a priest. After some generations he wanted to test whether there are any mistakes in passing down of knowledge . You are selected as the secretory to find out the mistakes . Write a program to find the maximum that may occur during the process.
If the values in the input string changes that means that either the Master priest or the learner priest might have done the mistakes. We should find maximum possible mistakes.
The first line of consists of number of test cases T followed by number of generations to evaluated N followed by the string of integers for each case.
output is the maximum number of priests that did mistake (probably).
1 < T < 10
1 < N < 100
Input: 2 6 1 2 1 3 4 1 7 2 2 3 3 3 3 1 Output: 6 4
In the above example case 1.1st , 2nd , 3rd , 4th , 5th , 6th priests might have done mistake . case 2 . 2nd , 3rd , 6th ,7th priests might have done the mistakes
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.5, RUBY, SCALA, SCM chicken, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.