# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154167 | AlexPascu007 | Baloni (COCI15_baloni) | C++98 | 2 ms | 376 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 <fstream>
using namespace std;
ifstream fin("baloni.in");
ofstream fout("baloni.out");
int n,i,sol,v[1000010],f[1000010];
int main() {
fin>>n;
for (i=1;i<=n;i++)
fin>>v[i];
for (i=1;i<=n;i++) {
if (f[v[i]]==0) {
sol++;
f[v[i]-1]++;
}
else {
f[v[i]]--;
f[v[i]-1]++;
}
}
fout<<sol;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |