# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
240833 | bananamaths | Baloni (COCI15_baloni) | C++17 | 7 ms | 1408 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 main()
{
ifstream in("input.txt");
ofstream out("output.txt");
int N;
in>>N;
int V[N];
for(int i = 0 ;i<N;i++)
{
in>>V[i];
}
bool H[1000002];
int conta = 0;
for(int i = 1;i<=1000001;i++)
{
H[i] = false;
}
for(int i = 0;i<N;i++)
{
int a = V[i];
if(H[a+1])
{
H[a+1] = false;
H[a] = true;
}
else
{
conta++;
H[a] = true;
}
}
out<<conta;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |