제출 #500291

#제출 시각아이디문제언어결과실행 시간메모리
500291aryan12앵무새 (IOI11_parrots)C++17
81 / 100
3 ms1048 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> pos1; int cnt1 = 0; for(int j = 0; j < 9; j++) { if((1 << j) & M[i]) { cnt1++; pos1.push_back(j); } } int sent_num = 0; sent_num += (8 * i); for(int j = 0; j < pos1.size(); j++) { send(sent_num + pos1[j]); } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { vector<int> one_bits[N]; for(int i = 0; i < L; i++) { int cur_num = X[i]; int pos = cur_num / 8; cur_num %= 8; one_bits[pos].push_back(cur_num); } for(int i = 0; i < N; i++) { int ans = 0; for(int j = 0; j < one_bits[i].size(); j++) { ans += (1 << one_bits[i][j]); } output(ans); } }

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

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:18:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |         for(int j = 0; j < pos1.size(); j++) {
      |                        ~~^~~~~~~~~~~~~

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:16:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for(int j = 0; j < one_bits[i].size(); j++) {
      |                        ~~^~~~~~~~~~~~~~~~~~~~
#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...