# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40702 | 2018-02-06T19:29:20 Z | Hassoony | Baloni (COCI15_baloni) | C++14 | 340 ms | 19904 KB |
#include <stdio.h> #include <stdlib.h> #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef double D; const ll inf=(1ll<<61); const ll mod=1e9+7; const int MX=1e6+9; int n,a[MX],ans,x; set<int>s; int main(){ cin>>n; for(int i=0;i<n;i++){ scanf("%d",&x); if(s.find(x)!=s.end()){ s.erase(s.find(x)); --x;if(x<=0)continue; s.insert(x); continue; } s.insert(x-1);ans++; } cout<<ans<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | Output isn't correct |
2 | Incorrect | 2 ms | 484 KB | Output isn't correct |
3 | Incorrect | 3 ms | 484 KB | Output isn't correct |
4 | Incorrect | 3 ms | 516 KB | Output isn't correct |
5 | Incorrect | 330 ms | 4248 KB | Output isn't correct |
6 | Incorrect | 340 ms | 7756 KB | Output isn't correct |
7 | Incorrect | 260 ms | 10568 KB | Output isn't correct |
8 | Incorrect | 252 ms | 13544 KB | Output isn't correct |
9 | Incorrect | 294 ms | 16696 KB | Output isn't correct |
10 | Incorrect | 279 ms | 19904 KB | Output isn't correct |