Submission #262048

#TimeUsernameProblemLanguageResultExecution timeMemory
262048NightlightParrots (IOI11_parrots)C++14
81 / 100
24 ms5356 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; int ada = 0; void encode(int N, int M[]) { ada = 0; for(int i = 0; i < N; i++) { for(int j = 0; j < 8; j++) { if(M[i] & (1 << j)) ada++; } } if(ada > 4 * N + 1) { send(0), send(0); for(int i = 0; i < N; i++) { for(int j = 0; j < 8; j++) { if(!(M[i] & (1 << j))) send(j * N + i); } } }else { for(int i = 0; i < N; i++) { for(int j = 0; j < 8; j++) { if(M[i] & (1 << j)) send(j * N + i); } } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; int ans[10005]; int cnt[1000005]; bool zero = 0; void decode(int N, int L, int X[]) { memset(ans, 0, sizeof(ans)); memset(cnt, 0, sizeof(cnt)); for(int i = 0; i < L; i++) cnt[X[i]]++; if(cnt[0] > 1) zero = 1; else zero = 0; if(zero) { for(int i = 1; i < 99999; i++) if(cnt[i]) ans[i % N] |= (1 << (i / N)); if(cnt[0] == 3) ans[0] |= 1; for(int i = 0; i < N; i++) { // cout << ((~ans[i]) & 255) << "\n"; output((~ans[i]) & 255); } }else { for(int i = 0; i < 99999; i++) if(cnt[i]) ans[i % N] |= (1 << (i / N)); for(int i = 0; i < N; i++) output(ans[i]); } // system("pause"); }
#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...