Submission #559585

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5595852022-05-10 08:41:32nekiHandcrafted Gift (IOI20_gift)C++14
100 / 100
297 ms66112 KiB
#include <bits/stdc++.h>
#include "gift.h"
#define ll long long
#define vc vector
using namespace std;
int construct(int n, int r, vc<int> a, vc<int> b, vc<int> x){
vc<vc<vc<int>>> ques(3, vc<vc<int>> (n));
for(int i=0;i<r;++i) ques[x[i]][b[i]].push_back(a[i]);
vc<pair<int, int>> ints;
for(int i=0;i<n;++i){
for(auto q: ques[1][i]){
while(ints.size() and q<=ints.back().second) ints.pop_back();
}
if(ints.size()==0) ints.emplace_back(0, i);
else if(ints.back().second<i) ints.emplace_back(ints.back().second+1, i);
}
int br=1, j=0;
for(int i=0;i<n;++i){
while(ints[j].second<i)++j;
for(auto q: ques[2][i]) if(ints[j].first<=q) br=0;
}
if(br){
string ans="";
char cur='R';
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...