Submission #596005

#TimeUsernameProblemLanguageResultExecution timeMemory
596005snasibov05Parrots (IOI11_parrots)C++14
88 / 100
13 ms1356 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int n, int m[]){ const int nn = 32; int mx = 8; for (int i = 0; i < n; ++i){ for (int j = 0; j < mx; ++j){ if (1 << j & m[i]) { if (i < nn) send(j * nn + i); else { send(j * nn + (i - nn)); send(j * nn + (i - nn)); } } } } }
#include "decoder.h" #include "decoderlib.h" #include "bits/stdc++.h" using namespace std; void decode(int n, int l, int x[]){ const int nn = 32; map<int, int> cnt; for (int i = 0; i < l; ++i) cnt[x[i]]++; vector<int> v(n); for (auto [cur, c] : cnt){ if (c == 1 || c == 3) v[cur % nn] += (1 << (cur / nn)); if (c == 2 || c == 3) v[cur % nn + nn] += (1 << (cur / nn)); } for (int i = 0; i < n; ++i) output(v[i]); }

Compilation message (stderr)

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:13:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   13 |     for (auto [cur, c] : cnt){
      |               ^
#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...