# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
853041 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 44 ms | 7760 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MX = 1e6+5;
void solve() {
int N;
cin >> N;
vector<int> cnt(MX);
int ans = 0;
for(int i = 0; i < N; i++) {
int x;
cin >> x;
if(cnt[x] == 0) {
ans++;
cnt[x]++;
}
cnt[x]--;
cnt[x-1]++;
}
cout << ans << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
// cin >> t;
while(t--) solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |