Submission #1112404

#TimeUsernameProblemLanguageResultExecution timeMemory
1112404vjudge1Baloni (COCI15_baloni)C++98
100 / 100
122 ms7928 KiB
// Online IDE - Code Editor, Compiler, Interpreter #include<bits/stdc++.h> using namespace std; int main() { int top=0; int x = 0; cin >> x; int arr[1000001] = {0}; vector<int> b(x); for(int i = 0;i < x;i++) cin >> b[i]; for(int a:b){ if(arr[a] > 0){ arr[a]--; arr[a-1]++; }else{ top++; arr[a-1]++; } }cout << top; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...