제출 #772929

#제출 시각아이디문제언어결과실행 시간메모리
772929PoonYaPat앵무새 (IOI11_parrots)C++14
0 / 100
3 ms648 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; vector<int> v; void put(int x) { for (int i=0; i<8; ++i) { if (x&(1<<i)) v.push_back(1); else v.push_back(0); } } void encode(int N, int M[]) { for (int i=0; i<N; ++i) put(M[i]); for (int i=0; i+1<v.size(); i+=2) { //consider bit i and i+1 if (v[i]==v[i+1]) send(i+v[i]); else { send(i); if (v[i]==0) send(i); else send(i+1); } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; vector<int> ans,group[128]; void decode(int N, int len, int X[]) { for (int i=0; i<len; ++i) group[X[i]/2].push_back(X[i]%2); for (int i=0; i<128; ++i) { if (group[i].size()==1) { ans.push_back(group[i][0]); ans.push_back(group[i][0]); } else { if (group[i][0]==group[i][1]) { ans.push_back(0); ans.push_back(1); } else { ans.push_back(1); ans.push_back(0); } } } for (int i=0; i+7<ans.size(); i+=8) { int res=0,mul=1; for (int j=0; j<8; ++j) { if (ans[i+j]==1) res+=mul; mul*=2; } output(res); } }

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

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

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