Submission #14827

#TimeUsernameProblemLanguageResultExecution timeMemory
14827minsuParrots (IOI11_parrots)C++14
81 / 100
8 ms2240 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]) { for(int i=0; i<N; i++){ int a = M[i] / 100; int b = M[i] / 10 % 10; int c = M[i] % 10; while( a!=0 || b!=0 || c!=0 ){ int s = i<<3; if(a) s |= 4, a--; if(b) s |= 2, b--; if(c) s |= 1, c--; send( s ); } } send( (N-1)<<3 ); }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { int i, b, n=0; vector<int> m(111); for(i=0; i<L; i++) { m[ X[i]>>3 ] += ((X[i]&4)!=0)*100 + ((X[i]&2)!=0)*10 + ((X[i]&1)!=0); n = max( n, X[i]>>3 ); } for(i=0; i<=n; i++) output( m[i] ); }

Compilation message (stderr)

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:9:10: warning: unused variable 'b' [-Wunused-variable]
   int i, b, n=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...