Submission #573447

#TimeUsernameProblemLanguageResultExecution timeMemory
573447VanillaParrots (IOI11_parrots)C++17
17 / 100
2 ms652 KiB
#include <bits/stdc++.h> #include "encoder.h" #include "encoderlib.h" using namespace std; vector <int> mp[256]; void encode(int n, int m[]) { int ct = 0; for (int i1 = 0; i1 <= 3 && ct < 256; i1++) for (int i2 = i1; i2 <= 3 && ct < 256; i2++) for (int i3 = i2; i3 <= 3 && ct < 256; i3++) for (int i4 = i3; i4 <= 3 && ct < 256; i4++) for (int i5 = i4; i5 <= 3 && ct < 256; i5++) for (int i6 = i5; i6 <= 3 && ct < 256; i6++) for (int i7 = i6; i7 <= 3 && ct < 256; i7++){ vector <int> v = {i1, i2, i3, i4, i5, i6, i7}; mp[ct++] = v; } for (int i = 0; i < n; i++) { for (int j = 0; j < 7; j++){ int v = i << 2; v+=mp[m[i]][j]; send(v); } } }
#include <bits/stdc++.h> #include "decoder.h" #include "decoderlib.h" using namespace std; const int maxn = 64; vector <int> v[maxn + 1]; map <vector <int>, int> revmp; void decode(int n, int l, int x[]) { int ct = 0; for (int i1 = 0; i1 <= 3 && ct < 256; i1++) for (int i2 = i1; i2 <= 3 && ct < 256; i2++) for (int i3 = i2; i3 <= 3 && ct < 256; i3++) for (int i4 = i3; i4 <= 3 && ct < 256; i4++) for (int i5 = i4; i5 <= 3 && ct < 256; i5++) for (int i6 = i5; i6 <= 3 && ct < 256; i6++) for (int i7 = i6; i7 <= 3 && ct < 256; i7++){ vector <int> x = {i1, i2, i3, i4, i5, i6, i7}; revmp[x] = ct++; } for (int i = 0; i < n; i++){ v[i].clear(); } for (int i = 0; i < l; i++){ int idx = x[i] >> 2; v[idx].push_back(x[i] & 3); } for (int i = 0; i < n; i++){ sort(v[i].begin(), v[i].end()); output(revmp[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...