Task: | Kortit |
Sender: | hltk |
Submission time: | 2020-09-26 16:10:11 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#2 | WRONG ANSWER | 0.01 s | 2 | details |
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'; } }