| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1283465 | uranhishig | Baloni (COCI15_baloni) | C++20 | 223 ms | 7432 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(a) (a).begin(),(a).end()
#define rep(i, n) for(int i = 0; i < (n); i++)
signed main(){
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++){
cin >> a[i];
}
map<int, int> mp;
int ans = 0;
for (int i = 0; i < n; i++) {
if(mp[a[i]] == 0) {
ans++;
mp[a[i]-1] = 1;
// cout << "NEMEGDLEE" << endl;
}
else {
mp[a[i]-1] = 1;
}
}
cout << ans;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
