# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
87721 | jvalsortav | Baloni (COCI15_baloni) | C++14 | 987 ms | 19852 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 <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cctype>
#include <ctime>
#include <set>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <utility>
#include <string>
#include <map>
using namespace std;
vector <int> v;
int n, x;
bool inf;
int main() {
cin >> n;
cin >> x;
v.push_back(x);
for (int i = 1; i < n; i++){
inf = true;
cin >> x;
for (int j = 0; j < v.size(); j++){
if (v[j] - 1 == x){
v[j] = x;
inf = false;
break;
}
}
if (inf){
v.push_back(x);
}
}
cout << v.size();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |