제출 #94658

#제출 시각아이디문제언어결과실행 시간메모리
94658andy627앵무새 (IOI11_parrots)C++17
컴파일 에러
0 ms0 KiB
#include "encoder.h" #include <stdio.h> #include <vector> #include <algorithm> #define pii pair<int,int> #define ff first #define ss second using namespace std; int n1; int M1[64]; void en_solve123(){ for(int i=0;i<n1;i++){ for(int j=0;j<8;j++){ send((i<<4)+(j<<1)+!!(M1[i]&(1<<j))); } } } vector<pii> vc(4); void en_solve45(){ for(int i=0;i<4;i++) vc[i].ss=i; for(int i=0;i<n1;i++){ for(int j=0;j<4;j++) vc[!!(M1[i]&(1<<(j<<1)))+(!!(M1[i]&(1<<(j<<1|1)))<<1)].ff++; } sort(vc.begin(),vc.end()); reverse(vc.begin(),vc.end()); int cha[4]; for(int i=0;i<4;i++) cha[vc[i].ss]=i; for(int i=0;i<4;i++) send((cha[0]<<6)+(cha[1]<<4)+(cha[2]<<2)+cha[3]); for(int i=0;i<n1;i++){ for(int j=0;j<4;j++){ //printf("%d %d %d\n",i,j,!!(M1[i]&(1<<(j<<1)))+(!!(M1[i]&(1<<(j<<1|1)))<<1)); for(int k=0;k<cha[!!(M1[i]&(1<<(j<<1)))+(!!(M1[i]&(1<<(j<<1|1)))<<1)];k++) send((i<<2)+j); } } } void encode(int N, int _M[]){ n1=N; for(int i=0;i<n1;i++) M1[i]=_M[i]; //printf("en\n"); for(int i=0;i<n1;i++) printf("%d ",M1[i]); printf("\n"); en_solve45(); return; if(n1<=16) en_solve123(); else en_solve45(); }
#include "decoder.h" #include <stdio.h> #include <algorithm> using namespace std; int n2,l; int X[1111],M2[64]; void de_solve123(){ for(int i=0;i<l;i++) M2[X[i]>>4]+=(X[i]%2)*(1<<((X[i]%16)>>1)); for(int i=0;i<n2;i++) output(M2[i]); //printf("de\n"); for(int i=0;i<n2;i++) printf("%d ",M2[i]); printf("\n"); } int cnt[64][4]; void de_solve45(){ for(int i=0;i<n2;i++){ for(int j=0;j<4;j++) cnt[i][j]=0; } //for(int i=0;i<n2;i++) printf("%d %d %d %d\n",cnt[i][0],cnt[i][1],cnt[i][2],cnt[i][3]); printf("\n"); for(int i=0;i<l;i++) cnt[X[i]>>2][X[i]%4]++; //for(int i=0;i<l;i++) printf("%d %d\n",X[i]>>2,X[i]%4); //for(int i=0;i<n2;i++) printf("%d %d %d %d\n",cnt[i][0],cnt[i][1],cnt[i][2],cnt[i][3]); printf("\n"); int rev[4]; for(int i=0;i<256;i++){ if(cnt[i>>2][i%4]>=4){ cnt[i>>2][i%4]-=4; rev[i>>6]=0; rev[(i%64)>>4]=1; rev[(i%16)>>2]=2; rev[i%4]=3; } } for(int i=0;i<n2;i++){ for(int j=0;j<4;j++) M2[i]+=rev[cnt[i][j]]*(1<<(j<<1)); output(M2[i]); } //printf("de\n"); for(int i=0;i<n2;i++) printf("%d ",M2[i]); printf("\n"); } void decode(int N, int L, int _X[]){ n2=N; l=L; for(int i=0;i<l;i++) X[i]=_X[i]; for(int i=0;i<n2;i++) M2[i]=0; de_solve45(); return; if(n2<=16) de_solve123(); else de_solve45(); }

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

encoder.cpp: In function 'void en_solve123()':
encoder.cpp:17:4: error: 'send' was not declared in this scope
    send((i<<4)+(j<<1)+!!(M1[i]&(1<<j)));
    ^~~~
encoder.cpp:17:4: note: suggested alternative: 'srand'
    send((i<<4)+(j<<1)+!!(M1[i]&(1<<j)));
    ^~~~
    srand
encoder.cpp: In function 'void en_solve45()':
encoder.cpp:34:23: error: 'send' was not declared in this scope
  for(int i=0;i<4;i++) send((cha[0]<<6)+(cha[1]<<4)+(cha[2]<<2)+cha[3]);
                       ^~~~
encoder.cpp:34:23: note: suggested alternative: 'srand'
  for(int i=0;i<4;i++) send((cha[0]<<6)+(cha[1]<<4)+(cha[2]<<2)+cha[3]);
                       ^~~~
                       srand
encoder.cpp:39:79: error: 'send' was not declared in this scope
    for(int k=0;k<cha[!!(M1[i]&(1<<(j<<1)))+(!!(M1[i]&(1<<(j<<1|1)))<<1)];k++) send((i<<2)+j);
                                                                               ^~~~
encoder.cpp:39:79: note: suggested alternative: 'srand'
    for(int k=0;k<cha[!!(M1[i]&(1<<(j<<1)))+(!!(M1[i]&(1<<(j<<1|1)))<<1)];k++) send((i<<2)+j);
                                                                               ^~~~
                                                                               srand

decoder.cpp: In function 'void de_solve123()':
decoder.cpp:12:24: error: 'output' was not declared in this scope
  for(int i=0;i<n2;i++) output(M2[i]);
                        ^~~~~~
decoder.cpp:12:24: note: suggested alternative: 'getpt'
  for(int i=0;i<n2;i++) output(M2[i]);
                        ^~~~~~
                        getpt
decoder.cpp: In function 'void de_solve45()':
decoder.cpp:44:3: error: 'output' was not declared in this scope
   output(M2[i]);
   ^~~~~~
decoder.cpp:44:3: note: suggested alternative: 'getpt'
   output(M2[i]);
   ^~~~~~
   getpt