CSES - Putka Open 2020 – 2/5 - Results
Submission details
Task:Kortit
Sender:hltk
Submission time:2020-09-26 16:10:11 +0300
Language:C++ (C++17)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.01 s1, 2details
#20.01 s2details

Code

#include <iostream>
int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int t;
	std::cin >> t;
	while (t--) {
		int n;
		std::cin >> n;
		int l = 0, p = 0, s = 0;
		for (int i = 1; i <= n / 2; ++i) {
			int x;
			std::cin >> x;
			l += x - p - 1;
			if (l > 0) {
				s++;
				l--;
			}
			p = x;
		}
		std::cout << s << '\n';
	}
}

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
...
Truncated

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
...
Truncated