# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
541761 | 2022-03-24T10:03:50 Z | FazacasMihai | Baloni (COCI15_baloni) | C++17 | 186 ms | 1668 KB |
#include <bits/stdc++.h> using namespace std; int v[100005]; int main() { int n, k = 1, i, j, l, nr, cnt = 1; bool ok; cin>>n; cin>>nr; v[nr]++; for(i = 2; i <= n; i++) { cin>>nr; if(v[nr + 1]) { v[nr]++; v[nr + 1]--; } else { cnt++; v[nr]++; } } cout<<cnt; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 175 ms | 1480 KB | Output is correct |
6 | Correct | 186 ms | 1668 KB | Output is correct |
7 | Correct | 142 ms | 948 KB | Output is correct |
8 | Correct | 141 ms | 1004 KB | Output is correct |
9 | Correct | 162 ms | 1264 KB | Output is correct |
10 | Correct | 161 ms | 1352 KB | Output is correct |