Submission #708990

#TimeUsernameProblemLanguageResultExecution timeMemory
708990vjudge1Baloni (COCI15_baloni)C++17
100 / 100
292 ms548 KiB
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back #define mp make_pair #define sz size() using namespace std; int main() { ll n; cin>>n; ll a,x=0; map<ll,ll> m; for(int i=0;i<n;i++){ cin>>a; if(m[a+1]==0) x++; else m[a+1]--; m[a]++; } cout<<x; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...