제출 #382847

#제출 시각아이디문제언어결과실행 시간메모리
382847alishahali1382최후의 만찬 (IOI12_supper)C++14
0 / 100
2594 ms6120 KiB
#include "advisor.h" #include <bits/stdc++.h> #pragma GCC optimize ("O2,unroll-loops") //#pragma GCC optimize("no-stack-protector,fast-math") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<pii, int> piii; typedef pair<ll, ll> pll; #define debug(x) cerr<<#x<<'='<<(x)<<endl; #define debugp(x) cerr<<#x<<"= {"<<(x.first)<<", "<<(x.second)<<"}"<<endl; #define debug2(x, y) cerr<<"{"<<#x<<", "<<#y<<"} = {"<<(x)<<", "<<(y)<<"}"<<endl; #define debugv(v) {cerr<<#v<<" : ";for (auto x:v) cerr<<x<<' ';cerr<<endl;} #define all(x) x.begin(), x.end() #define pb push_back #define kill(x) return cout<<x<<'\n', 0; const int inf=1000000010; const ll INF=1000000000000001000LL; const int mod=1000000007; const int MAXN=300010, LOG=20; int nex[MAXN], last[MAXN]; void ComputeAdvice(int *C, int N, int K, int M){ for (int i=0; i<N; i++) last[i]=N; for (int i=N-1; ~i; i--){ nex[i]=last[C[i]]; last[C[i]]=i; } for (int i=0; i<N; i++) WriteAdvice(last[i]<N); for (int i=0; i<N; i++) WriteAdvice(nex[i]<N); }
#include "assistant.h" #include <bits/stdc++.h> #pragma GCC optimize ("O2,unroll-loops") //#pragma GCC optimize("no-stack-protector,fast-math") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<pii, int> piii; typedef pair<ll, ll> pll; #define debug(x) cerr<<#x<<'='<<(x)<<endl; #define debugp(x) cerr<<#x<<"= {"<<(x.first)<<", "<<(x.second)<<"}"<<endl; #define debug2(x, y) cerr<<"{"<<#x<<", "<<#y<<"} = {"<<(x)<<", "<<(y)<<"}"<<endl; #define debugv(v) {cerr<<#v<<" : ";for (auto x:v) cerr<<x<<' ';cerr<<endl;} #define all(x) x.begin(), x.end() #define pb push_back #define kill(x) return cout<<x<<'\n', 0; const int inf=1000000010; const ll INF=1000000000000001000LL; const int mod=1000000007; const int MAXN=300010, LOG=20; bool A[MAXN], B[MAXN]; void Assist(unsigned char *AA, int N, int K, int R){ for (int i=0; i<N; i++) A[i]=AA[i], B[i]=(i<K); for (int i=N; i<N+N; i++){ int col=GetRequest(); A[col]=AA[i]; if (!B[col]){ bool ok=0; for (int j=0; j<N && !ok; j++) if (B[j] && !A[j]){ PutBack(j); B[j]=0; ok=1; } for (int j=0; j<N && !ok; j++) if (B[j]){ PutBack(j); B[j]=0; ok=1; } assert(ok); B[col]=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...