# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
319661 | ignaciocanta | Baloni (COCI15_baloni) | C++14 | 218 ms | 8036 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;
#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);
typedef long long tint;
int main(){
int n; cin >> n;
vector<int> a (n);
forn(i, n) cin >> a[i];
vector<int> visited (1000002, 0);
vector<bool> tiene (n, 0);
forn(i, n){
visited[a[i]]++;
if(visited[a[i]+1]){ tiene[i] = 1; visited[a[i]+1]--;}
}
int cont = 0;
forn(i, n){
if(tiene[i] == 0) cont++;
}
cout << cont << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |