# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
541761 | FazacasMihai | Baloni (COCI15_baloni) | C++17 | 186 ms | 1668 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int v[100005];
int main()
{
int n, k = 1, i, j, l, nr, cnt = 1;
bool ok;
cin>>n;
cin>>nr;
v[nr]++;
for(i = 2; i <= n; i++)
{
cin>>nr;
if(v[nr + 1])
{
v[nr]++;
v[nr + 1]--;
}
else
{
cnt++;
v[nr]++;
}
}
cout<<cnt;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |