Submission #248521

#TimeUsernameProblemLanguageResultExecution timeMemory
248521A02Parrots (IOI11_parrots)C++14
0 / 100
3 ms1536 KiB
#include "encoder.h" #include "encoderlib.h" #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <set> #include <utility> #include <string> using namespace std; void encode(int N, int M[]) { vector<bool> message; for(int i = 0; i < N; i++){ for (int j = 7; j >= 0; j--){ message.push_back((M[i] & (1 << j))); } } for (int i = 0; i < N; i++){ cout << M[i] << ' '; } cout << endl; for (int i = 0; i < message.size(); i++){ cout << message[i] << ' ';; } cout << endl; for (int i = 0; i < 4 * N; i++){ send((4 * i + 2 * message[2 * i] + message[2 * i + 1])); } }
#include "decoder.h" #include "decoderlib.h" #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <set> #include <utility> using namespace std; //bool pairc void decode(int N, int L, int X[]) { vector<pair<int, int> > recieved; vector<int> full_recieved; for(int i=0; i<L; i++) { recieved.push_back(make_pair(X[i] >> 2, X[i] & 3)); } sort(recieved.begin(), recieved.end()); for (int i = 0; i < recieved.size(); i++){ //cout << recieved[i].first << " : " << recieved[i].second << endl; full_recieved.push_back(recieved[i].second); cout << 'r' << recieved[i].second << endl; } for (int i = 0; i < N; i++){ output(((full_recieved[4 * i] << 6) + (full_recieved[4 * i + 1] << 4) + (full_recieved[4 * i + 2] << 2) + (full_recieved[4 * i + 3]))); } }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:32:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < message.size(); i++){
                     ~~^~~~~~~~~~~~~~~~

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:26:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < recieved.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...