Submission #573458

#TimeUsernameProblemLanguageResultExecution timeMemory
573458VanillaParrots (IOI11_parrots)C++17
92 / 100
16 ms1668 KiB
#include <bits/stdc++.h> #include "encoder.h" #include "encoderlib.h" using namespace std; vector <int> mp[300]; 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++) for (int i8 = i7; i8 <= 3 && ct < 256; i8++) for (int i9 = i8; i9 <= 3 && ct < 256; i9++) for (int i10 = i9; i10 <= 3 && ct < 256; i10++){ vector <int> x = {i1, i2, i3, i4, i5, i6, i7, i8, i9, i10}; mp[ct++] = x; } for (int i = 0; i < n; i++) { for (int j = 0; j < 10; 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; vector <int> v[300]; 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++) for (int i8 = i7; i8 <= 3 && ct < 256; i8++) for (int i9 = i8; i9 <= 3 && ct < 256; i9++) for (int i10 = i9; i10 <= 3 && ct < 256; i10++){ vector <int> x = {i1, i2, i3, i4, i5, i6, i7, i8, i9, i10}; 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...