Submission #541728

#TimeUsernameProblemLanguageResultExecution timeMemory
541728nutzuBaloni (COCI15_baloni)C++11
0 / 100
192 ms7260 KiB
#include <iostream> using namespace std; long long n,i,s,x,x1,v[1000001],v1[1000001]; int main() { cin>>n; for(i=1; i<=n; i++) { cin>>v[i]; } for(i=1; i<=n; i++) { if(v[i]!=v[i-1]-1) { if(v1[v[i]]>0) v1[v[i]]--; else { s++; v1[v[i]]=v[i]; } } } cout<<s; }
#Verdict Execution timeMemoryGrader output
Fetching results...