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:||C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.