# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
956180 | lalig777 | Baloni (COCI15_baloni) | C++14 | 135 ms | 7268 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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
int main(){
int n, ans=0; cin>>n;
vector<int>v(1e6, 0);
while (n--){
int a; cin>>a;
if (v[a-1]>0){
v[a-1]--;
if (a-2>=0) v[a-2]++;
}else{
ans++;
if (a-2>=0) v[a-2]++;
}
}cout<<ans<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |