Submission #1000052

#TimeUsernameProblemLanguageResultExecution timeMemory
1000052NintsiChkhaidzeParrots (IOI11_parrots)C++17
0 / 100
1 ms1316 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #include "encoder.h" #include "encoderlib.h" //#include "parrotslib.h" using namespace std; const int MN = 3e5 + 5; int xx[MN],yy[MN]; int len ; int get(int b,int idx){ int x = b; if (idx < 10) x = x*10 + idx; else x = x*100 + idx; return x; } void encode(int N, int M[]){ int id = -1; for (int i = 0; i < N; i++){ int x = M[i]; for (int j = 8; j >= 0; j--){ if (((x >> j) & 1)){ xx[++id] = get(j + 1,i); } } } len = id + 1; for (int i=0;i<=id;i++) send(xx[i]); }
#include <bits/stdc++.h> #include "decoder.h" #include "decoderlib.h" #define ll long long #define pb push_back //#include "parrotslib.h" using namespace std; const int MN = 3e5 + 5; int xx[MN],yy[MN]; int len ; void decode(int N, int L, int X[]){ for (int i = 0; i < len; i++){ int x = X[i]; int A = 0,B = 0; if (x < 100) A = x/10,B = x%10; else A = x/100,B = x - A*100; yy[B] |= (1<<(A - 1)); } for (int i=0;i<N;i++) output(yy[i]); } /* int get(int b,int idx){ int x = b; if (idx < 10) x = x*10 + idx; else x = x*100 + idx; return x; } void encode(int N, int M[]){ int id = -1; for (int i = 0; i < N; i++){ int x = M[i]; for (int j = 8; j >= 0; j--){ if (((x >> j) & 1)){ xx[++id] = get(j + 1,i); } } } len = id + 1; for (int i=0;i<=id;i++) send(xx[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...