# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112395 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 234 ms | 7368 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 int long long
#define pb push_back
#define F first
#define S second
#define all(v) v.begin(),v.end()
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<int,int> mii;
const int INF = 2e5 + 100;
int n;
vi h;
mii mp;
int32_t main(){
cin >> n;
h.resize(n);
for (int i = 0; i < n; i++){
cin >> h[i];
}
int cnt = 0;
for (int i = 0; i < n; i++){
if (mp[h[i]+1] == 0) cnt++;
else mp[h[i]+1]--;
mp[h[i]]++;
}
cout << cnt;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |