# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
191494 | dndhk | Sushi (JOI16_sushi) | C++14 | 7555 ms | 10764 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 pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAX_N = 400000;
const int SQ = 700;
int N, Q;
int arr[MAX_N+1];
int g[MAX_N+1];
priority_queue<int> pq1[SQ+1], pq2;
int solve(int gn, int s, int e, int k){
int x = gn*SQ+1, y = min((gn+1)*SQ, N);
//cout<<s<<" "<<e<<" "<<k<<" "<<endl;
//cout<<x<<" "<<y<<endl;
if(s<=x && y<=e){
pq1[gn].push(k);
k = pq1[gn].top();
pq1[gn].pop();
return k;
}else{
for(int i=y; i>=x; i--){
while(!pq1[gn].empty() && !pq2.empty() && pq1[gn].top()==pq2.top()){
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... |