Submission #24466

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
244662017-06-09 08:57:55gs14004Last supper (IOI12_supper)C++11
100 / 100
241 ms10600 KiB
#include "advisor.h"
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
typedef pair<int,int> pi;
set<pi> s;
vector<pi> nexts;
int query[100005];
int is_in[100005];
int getnxt(int val, int time){
auto t = upper_bound(nexts.begin(), nexts.end(), pi(val, time));
if(t->first != val) return 1e9;
return t->second;
}
bool PopPrevRequest[100005];
bool PopK[100005];
void ComputeAdvice(int *C, int N, int K, int M) {
for(int i=0; i<N; i++){
nexts.push_back(pi(C[i], i));
}
sort(nexts.begin(), nexts.end());
for(int i=0; i<K; i++){
s.insert(pi(getnxt(i, -1), i));
is_in[i] = 1;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

assistant.cpp: In function 'void Assist(unsigned char*, int, int, int)':
assistant.cpp:7:9: warning: unused variable 'prevReq' [-Wunused-variable]
     int prevReq = -1;
         ^~~~~~~
#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...