제출 #345764

#제출 시각아이디문제언어결과실행 시간메모리
345764daniel920712앵무새 (IOI11_parrots)C++14
0 / 100
5 ms1488 KiB
#include "encoder.h" #include "encoderlib.h" #include <vector> #include <algorithm> using namespace std; void encode(int N, int M[]) { vector < pair < int , int > > all2; int i,t=0; for(i=0; i<N; i++) { send(M[i]); send(M[i]); send(M[i]); send(M[i]); all2.push_back(make_pair(M[i],i)); } sort(all2.begin(),all2.end()); for(i=0;i<N;i++) { send(i/8*32+all2[i].second); send(i/8*32+all2[i].second); send(i%8*32+all2[i].second); } }
#include "decoder.h" #include "decoderlib.h" #include <map> #include <vector> #include <utility> #include <algorithm> using namespace std; void decode(int N, int L, int X[]) { vector < int > all; map < int , int > con; int ans[305]; int where[305]; int i,j, b; for(i=0; i<L; i++) { con[X[i]]++; } for(i=0; i<N; i++) all.push_back(0); for(auto i:con) { for(j=0;j<i.second/4;j++) all.push_back(i.first); } sort(all.begin(),all.end()); //for(i=0;i<N;i++) printf("%d\n",all[i]); for(auto i:con) { //printf("%d %d\n",i.first,i.second); //if(i.second%4) printf("%d\n",i.first/32); if(i.second%4==2) { //printf("%d %d\n",i.first%16,i.first/16); where[i.first%32]+=i.first/32*8; } else if(i.second%4==1) { where[i.first%32]+=i.first/32; } else if(i.second%4==3) { where[i.first%32]+=i.first/32; where[i.first%32]+=i.first/32*8; } } for(i=0; i<N; i++) { //printf("%d ",where[i]); output(all[where[i]]); //printf("%d\n",all[where[i]]); } }

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

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:10:11: warning: unused variable 't' [-Wunused-variable]
   10 |     int i,t=0;
      |           ^

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:13:9: warning: unused variable 'ans' [-Wunused-variable]
   13 |     int ans[305];
      |         ^~~
decoder.cpp:15:14: warning: unused variable 'b' [-Wunused-variable]
   15 |     int i,j, b;
      |              ^
#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...