Submission #135243

#TimeUsernameProblemLanguageResultExecution timeMemory
135243zoooma13Parrots (IOI11_parrots)C++14
88 / 100
25 ms1776 KiB
#include "bits/stdc++.h" #include "encoder.h" #include "encoderlib.h" using namespace std; void encode(int N, int M[]) { vector <bool> bin(8*N ,0); for(int i=0; i<N; i++) for(int j=0; j<8; j++) bin[8*i+j] = M[i]&(1<<j); for(int i=0; i<bin.size(); i++) if(bin[i]){ send(i & 255); if(i >= 256) send(i & 255); } }
#include "bits/stdc++.h" #include "decoder.h" #include "decoderlib.h" using namespace std; void decode(int N, int L, int X[]) { vector <bool> bin(8*N ,0); for(int i=0; i<L; i++){ if(count(X ,X+L ,X[i]) == 3) bin[256+X[i]] = 1 ,bin[X[i]] = 1; else if(count(X ,X+L ,X[i]) == 2) bin[256+X[i]] = 1; else if(count(X ,X+L ,X[i]) == 1) bin[X[i]] = 1; } for(int i=0; i<N; i++){ int num = 0; for(int j=0; j<8; j++) num |= (1<<j)*bin[8*i+j]; output(num); } }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:13:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0; i<bin.size(); 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...