# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
549470 | LucaDantas | Arranging Tickets (JOI17_arranging_tickets) | C++17 | 1081 ms | 15872 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;
constexpr int maxn = 2e5+10;
long long a[maxn]; // quantos caras precisam passar por cada pos
vector<pair<int,int>> opa[maxn];
bool check(long long qtd_mov, long long M, int sz) {
vector<long long> mov(sz+1);
for(int i = 1; i <= sz; i++)
mov[i] = (a[i] + qtd_mov - M + 1) / 2;
priority_queue<pair<int, int>> q;
vector<long long> add_lazy(sz+1);
long long usados = 0, lazy = 0;
for(int i = 1; i <= sz; i++) {
for(pair<int,int> par : opa[i])
q.push(par);
lazy += add_lazy[i];
mov[i] += lazy;
while(mov[i] > 0) {
if(!q.size() || q.top().first <= i) return 0; // não da pra fazer
pair<int,int> usar = q.top();
q.pop();
if(usar.second > mov[i])
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... |