Submission #29137

#TimeUsernameProblemLanguageResultExecution timeMemory
29137dereotuParrots (IOI11_parrots)C++14
0 / 100
5 ms2232 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> #define pii pair<int,int> #define mp make_pair #define pb push_back #define st first #define nd second #define forr(i,A,B) for(int i=A;i<B;++i) #define space ' ' #define endl '\n' #define LL long long using namespace std; void encode(int N, int M[]) { int i; int zero=0,one=0; for(i=0; i<N; i++){ if(M[i]==0){ zero++; send(M[i]); } else{ one++; send(one+zero); } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> #define pii pair<int,int> #define mp make_pair #define pb push_back #define st first #define nd second #define forr(i,A,B) for(int i=A;i<B;++i) #define space ' ' #define endl '\n' #define LL long long using namespace std; void decode(int N, int L, int X[]) { int b[N]; sort(X,X+N,greater<int>()); forr(i,0,N){ if(X[i]){ b[X[i]]=1; } } forr(i,0,N){ output(b[i]?1:0); } }
#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...