제출 #916658

#제출 시각아이디문제언어결과실행 시간메모리
916658Wansur앵무새 (IOI11_parrots)C++14
17 / 100
14 ms3224 KiB
#include <bits/stdc++.h> #define f first #define s second #define ent '\n'; using namespace std; typedef long long ll; const int mx=2e5+12; void output(int b); void send(int a); int cnt[mx]; void encode(int n, int a[]){ mt19937 rnd(1349); for(int i=0;i<n;i++){ send(a[i]); for(int t=0;t<9;t++){ int x=rnd()%256; send((a[i]^x)); } } }
#include <bits/stdc++.h> #define f first #define s second #define ent '\n'; using namespace std; typedef long long ll; const int mx=2e5+12; void output(int b); void send(int a); int cnt[mx]; void decode(int m, int n, int a[]){ sort(a,a+n); for(int i=0;i<256;i++){ cnt[i]=0; } for(int i=0;i<n;i++){ cnt[a[i]]++; } mt19937 rnd(1349); for(int i=0;i<m;i++){ vector<int> v; for(int t=0;t<9;t++){ int x=rnd()%256; v.push_back(x); } for(int x=0;x<=256;x++){ vector<int> t={x}; int mn=--cnt[x]; for(int y:v){ mn=min(mn,--cnt[(x^y)]); t.push_back((x^y)); } if(mn>=0){ output(x); break; } for(int x:t){ cnt[x]++; } } } }
#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...