Submission #1158782

#TimeUsernameProblemLanguageResultExecution timeMemory
1158782SmuggingSpunLast supper (IOI12_supper)C++20
8 / 100
24 ms1352 KiB
#include<bits/stdc++.h> #include "advisor.h" using namespace std; void ComputeAdvice(int *C, int n, int k, int m){ if(n <= 5000 && m == 65000){ for(int i = 0; i < n; i++){ for(int j = 0; j < 13; j++){ WriteAdvice((1 << j & C[i]) ? 1 : 0); } } return; } }
#include<bits/stdc++.h> #include "assistant.h" using namespace std; void Assist(unsigned char *A, int n, int k, int R){ if(n <= 5000 && R == 13 * n){ vector<vector<int>>p(n); for(int i = 0; i < n; i++){ int num = 0; for(int j = 0; j < 13; j++){ if(A[i * 13 + j] == 1){ num |= 1 << j; } } p[num].emplace_back(i); } for(int i = 0; i < n; i++){ reverse(p[i].begin(), p[i].end()); } vector<int>scaf(k); iota(scaf.begin(), scaf.end(), 0); for(int i = 0; i < n; i++){ int color = GetRequest(); if(find(scaf.begin(), scaf.end(), color) == scaf.end()){ int candidate = 0; for(int j = 0; j < scaf.size(); j++){ int x = scaf[j]; while(!p[x].empty() && p[x].back() <= i){ p[x].pop_back(); } if(p[x].empty() || (!p[scaf[candidate]].empty() && p[scaf[candidate]].back() < p[x].back())){ candidate = j; } } PutBack(scaf[candidate]); swap(scaf[candidate], scaf.back()); scaf.pop_back(); scaf.emplace_back(color); } } return; } }
#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...