# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41565 | grumpy_gordon | Arranging Tickets (JOI17_arranging_tickets) | C++14 | 1181 ms | 39260 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 <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
typedef long long ll;
typedef pair<int, int> pi; typedef pair<ll, int> pli; typedef pair<ll, pi> plp;
typedef tuple<int, int, int> ti; typedef tuple<ll, int, int> tli;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll * INF * INF;
const int MAX_N = 2e5 + 100, MAX_M = 1e5 + 100, MAX_C = 1e9 + 100;
int N, M; ti Nr[MAX_M];
ll Sum[MAX_N], Temp[MAX_N], maxV;
bool isCan(ll use, ll lim) {
ll up = lim - use;
ll cnt = 0;
priority_queue<pi> Q;
for(int i=0; i<=N; i++) Temp[i] = 0;
for(int i=1, j=0; i<=N; i++) {
Temp[i] += Temp[i-1];
while(j < M && get<0>(Nr[j]) == i) Q.push(pi(get<1>(Nr[j]), get<2>(Nr[j]))), j++;
ll now = Sum[i] + Temp[i];
while(!Q.empty() && now > up) {
int y, c; tie(y, c) = Q.top(); Q.pop();
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |