Submission #993003

#TimeUsernameProblemLanguageResultExecution timeMemory
993003kokoxuyaParrots (IOI11_parrots)C++14
81 / 100
3 ms1568 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; //#define int long long #define pb push_back #define pii pair<int,int> #define ss second #define ff first #define debu(x) (cerr << #x << " = "<< x << "\n") #define bitout(x,y) {\ cerr << #x << " : ";\ for (int justforbits = y; justforbits >=0; justforbits--)cout << (((1 << justforbits) & x)>=1);\ cout << "\n";\ } void encode(int N, int M[]) { for (int a = 0; a < N; a++) { for (int b = 0; b < 8; b++) { if ((M[a] & (1 << b))==0)continue; int thenum = (a << 3); //cout << a << " , "; //bitout(a,8); thenum += b; //bitout(thenum,8); send(thenum); } } }
//#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; //#define int long long #define pb push_back #define pii pair<int,int> #define ss second #define ff first #define debu(x) (cerr << #x << " = "<< x << "\n") #define bitout(x,y) {\ cerr << #x << " : ";\ for (int justforbits = y; justforbits >=0; justforbits--)cout << (((1 << justforbits) & x)>=1);\ cout << "\n";\ } #include "decoder.h" #include "decoderlib.h" void decode(int N, int L, int X[]) { vector<int>thenums(N,0); for (int a = 0; a < L; a++) { int pos = (X[a] >> 3); //debu(pos); X[a]-=(pos << 3); int inpos = X[a]; X[a] -= (inpos); thenums[pos] = (thenums[pos] | (1 << inpos)); } for(int i=0; i<N; i++) { int b = thenums[i]; output(b); } }
#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...