Submission #339208

#TimeUsernameProblemLanguageResultExecution timeMemory
339208ammar2000Baloni (COCI15_baloni)C++17
60 / 100
2098 ms4916 KiB
#include <bits/stdc++.h> using namespace std; int n,co; int v[100000000]; bool take[100000000]; int main() { cin>>n; //v.resize(n); for (int i=0;i<n;i++) cin>>v[i]; for (int i=0;i<n;i++) {int c=1; for (int z=i;z>=0;z--) { if (v[z]==v[i]+1&&take[z]==0) {c=0; take[z]=1; break;} } co+=c; } cout <<co; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...