Submission #1051808

#TimeUsernameProblemLanguageResultExecution timeMemory
1051808Zbyszek99Parrots (IOI11_parrots)C++17
81 / 100
2 ms1340 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i = a; i <= b; i++) void encode(int n, int m[]) { rep(i,0,n-1) { rep(bit,0,7) { if(m[i] & (1 << bit)) { send(bit + (i << 3)); } } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i = a; i <= b; i++) void decode(int n, int l, int x[]) { vector<int> ans(n,0); rep(i,0,l-1) { int bit = 0; if(x[i] & 1) bit += 1; if(x[i] & 2) bit += 2; if(x[i] & 4) bit += 4; int poz = x[i] >> 3; ans[poz] |= (1 << bit); } rep(i,0,n-1) output(ans[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...