# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
95338 | dalgerok | Candies (JOI18_candies) | C++14 | 673 ms | 27512 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>
#define int long long
using namespace std;
const int N = 2e5 + 5, INF = 5e18;
int n, a[N], ans;
set < int > alive;
set < pair < int, int > > q;
main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin >> n;
for(int i = 1; i <= n; i++){
cin >> a[i];
q.insert(make_pair(a[i], i));
}
a[0] = a[n + 1] = -INF;
for(int i = 0; i <= n + 1; i++){
alive.insert(i);
}
for(int i = 1; i <= (n + 1) / 2; i++){
int pos = q.rbegin()->second,
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |