# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
47913 | Just_Solve_The_Problem | Candies (JOI18_candies) | C++11 | 141 ms | 65096 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 pii pair < ll, ll >
#define fr first
#define sc second
#define mk make_pair
#define ll long long
const ll inf = (ll)1e15 + 7;
const int N = (int)2e5 + 7;
int n;
priority_queue < pii > q;
ll a[N];
int prv[N], nxt[N];
main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%lld", &a[i]);
q.emplace(mk(a[i], i));
if (i > 1)
prv[i] = i - 1;
if (i < n)
nxt[i] = i + 1;
}
ll ans = 0;
for (int j = 1; j <= (n + 1) / 2; j++) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |