# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1111992 | Almonther | Baloni (COCI15_baloni) | C++98 | 157 ms | 760 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>
#define co cout<<
#define ll long long
#define suiii ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
//stuff
void solve(){
ll n;
cin>>n;
ll ans=0,x;
map<ll,ll>mp;
for(int i=0;i<n;i++){
cin>>x;
mp[x-1]++;
if(mp[x]<=0) ans++;
else mp[x]--;
}
co ans;
}
int main(){
suiii
int _=1;
//cin>>_;
while(_--) solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |