Submission #1240127

#TimeUsernameProblemLanguageResultExecution timeMemory
1240127countlessParrots (IOI11_parrots)C++20
24 / 100
13 ms836 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define sp <<" "<< #define endl "\n" void encode(int N, int M[]) { for (int i = 0; i < N; i++) { cerr << M[i] << " "; } cerr << endl; vector<int> one; for (int i = 0; i < N; i++) { for (int j = 0; j < 8; j+=2) { int rep = 0; if (M[i] & (1 << j)) { rep |= (1 << 0); } if (M[i] & (1 << (j+1))) { rep |= (1 << 1); } while (rep--) { one.push_back((i * 8 + j) / 2); } } } for (auto &x : one) { send(x); } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define sp <<" "<< #define endl "\n" void decode(int N, int L, int X[]) { vector<int> M(N, 0); vector<int> cnt(256); for (int i = 0; i < L; i++) { cnt[X[i]]++; } for (int i = 0; i < 256; i++) { int j = i * 2; int pos = j / 8, bit = j % 8; if (cnt[i] & (1 << 0)) { M[pos] |= (1 << bit); } if (cnt[i] & (1 << 1)) { M[pos] |= (1 << (bit+1)); } } for (int i = 0; i < N; i++) { cerr << M[i] << " "; } cerr << endl; for (auto &x : M) { output(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...