Submission #574897

#TimeUsernameProblemLanguageResultExecution timeMemory
574897FatihSolakLast supper (IOI12_supper)C++17
0 / 100
122 ms12104 KiB
#include "advisor.h" #include <bits/stdc++.h> using namespace std; void ComputeAdvice(int *c, int n, int k, int m){ vector<int> occ[n]; for(int i = n-1;i>=0;i--){ occ[c[i]].push_back(i); } for(int i = 0;i<k;i++){ WriteAdvice(occ[i].empty()); } for(int i = 0;i<n;i++){ occ[c[i]].pop_back(); WriteAdvice(occ[c[i]].empty()); } }
#include "assistant.h" #include <bits/stdc++.h> using namespace std; void Assist(unsigned char *a, int n, int k, int r) { set<int> s,now; int last = 0; for(int i = 0;i<k;i++){ if(a[last++] == 1){ s.insert(i); } now.insert(i); } for (int i = 0; i < n; i++) { int req = GetRequest(); if(now.count(req) == 0){ int num = *now.begin(); if(s.size()){ num = *s.begin(); s.erase(s.begin()); } now.erase(num); PutBack(num); now.insert(req); } if(a[last++] == 1){ s.insert(req); } } }
#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...