제출 #933783

#제출 시각아이디문제언어결과실행 시간메모리
933783AtabayRajabli앵무새 (IOI11_parrots)C++17
0 / 100
1 ms1308 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++) { vector<int> msg; for(int j = 4; j >= 0; j--) { msg.push_back((1 << j) & i); } for(int j = 7; j >= 0; j--) { if((1 << j) & M[i]) { for(int k = 2; k >= 0; k--) { msg.push_back((1 << k) & j); } } } int snd = 0; int j = 7; for(int i = 0; i < msg.size(); i++) { snd += (1 << j) * msg[i]; } send(snd); } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { vector<int> ans(N, 0); for(int i = 0; i < L; i++) { int ind = 0; for(int j = 7; j >= 3; j--) { if((1 << j) & X[i])ind += (1 << (j - 3)); } int y = 0; for(int j = 2; j >= 0; j--) { y += ((1 << j) & X[i]); } ans[ind] += (1 << y); } for(int i = 0; i < N; i++)output(ans[i]); }

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:28:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |     for(int i = 0; i < msg.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...