Submission #1016628

#TimeUsernameProblemLanguageResultExecution timeMemory
1016628nisanduuParrots (IOI11_parrots)C++17
52 / 100
3 ms1332 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]) { for(int i=0;i<N;i++){ int st = i; int tmpst = 0; vector<int> bitss(8); for(int j=4;j>=0;j--){ if(st&(1<<j)){ bitss[3+j]=1; } } for(int k=0;k<=7;k++){ if(bitss[k]){ tmpst += (1<<k); } } for(int j=0;j<=7;j++){ if(M[i]&(1<<j)){ vector<int> tmp = bitss; for(int k=0;k<3;k++){ if((1<<k)&j){ tmp[k]=1; } } int num = 0; for(int k=0;k<=7;k++){ if(tmp[k]==0) continue; num += (1<<k); } send(num); } } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { vector<int> v(N+5); int lol = (1<<6) | (1<<5) | (1<<4) | (1<<3); int l2 = 1 | (1<<1) | (1<<2); for(int i=0;i<L;i++){ int pos = (X[i]&(lol))>>3; int bit = X[i]&l2; int val = (1<<bit); v[pos] = v[pos] ^ val; } for(int i=0;i<N;i++) output(v[i]); }
#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...