제출 #248521

#제출 시각아이디문제언어결과실행 시간메모리
248521A02앵무새 (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]))); } }

컴파일 시 표준 에러 (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...