# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1112404 |
2024-11-14T07:17:26 Z |
vjudge1 |
Baloni (COCI15_baloni) |
C++ |
|
122 ms |
7928 KB |
// 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 time |
Memory |
Grader output |
1 |
Correct |
4 ms |
4176 KB |
Output is correct |
2 |
Correct |
5 ms |
4176 KB |
Output is correct |
3 |
Correct |
4 ms |
4176 KB |
Output is correct |
4 |
Correct |
5 ms |
4176 KB |
Output is correct |
5 |
Correct |
108 ms |
7248 KB |
Output is correct |
6 |
Correct |
122 ms |
7928 KB |
Output is correct |
7 |
Correct |
88 ms |
6992 KB |
Output is correct |
8 |
Correct |
88 ms |
7160 KB |
Output is correct |
9 |
Correct |
100 ms |
7248 KB |
Output is correct |
10 |
Correct |
98 ms |
7248 KB |
Output is correct |