CSES - Putka Open 2020 – 2/5 - Results
Submission details
Task:Kortit
Sender:TapaniS
Submission time:2020-09-25 20:22:53 +0300
Language:Java
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.23 s1, 2details
#20.36 s2details

Code

import java.util.*;

public class kortit {

	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);

		int tests = input.nextInt();

		int[] ans = new int[tests];
		int card = 0;

		for (int k = 0; k < tests; k++) {
			int qty = input.nextInt() / 2;

			int winners = 0;
			for (int i = 0; i < qty; i++) {
				card = input.nextInt();

				if (card > winners + i + 1) winners++;

			}
			ans[k] = winners;
		}


		for (int i = 0; i < tests; i++) {

			System.out.println(ans[i]);
		}
		input.close(); 
    }
}

Test details

Test 1

Group: 1, 2

Verdict:

input
1000
2
1
6
2 4 5
...

correct output
0
2
0
2
1
...

user output
0
2
0
2
1
...

Test 2

Group: 2

Verdict:

input
1000
70
56 23 58 70 2 57 27 61 47 3 42...

correct output
30
15
1
38
29
...

user output
20
9
1
27
19
...