Submission #772922

#TimeUsernameProblemLanguageResultExecution timeMemory
772922AmylopectinParrots (IOI11_parrots)C++14
98 / 100
7 ms1360 KiB
#include "encoder.h" #include "encoderlib.h" const int mxn = 1010; // struct we // { // int s1,s2,s3,s4; // }; int hm[mxn][10] = {}; int cva[mxn] = {},ru = 0,wa[mxn]= {},of1 = 0; int re(int res,int dep) { int i,j,fn; if(dep == 4) { for(i=0; i<4; i++) { hm[ru][i] = wa[i]; } ru++; return 0; } for(i=0; i<=res; i++) { wa[dep] = i; re(res-i,dep+1); } return 0; } void encode(int n, int mes[]) { int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192}; if(of1 == 0) { re(7,0); } of1 = 1; for(i=0; i<n; i++) { cn = (i<<2); cru = 0; for(j=0; j<4; j++) { for(k=0; k<hm[mes[i]][j]; k++) { send(cn | j); } // cva[j] = ((mes[i] & dn[j]) >> (j*2)); } // send(cn | cva[0]); // for(j=1; j<4; j++) // { // if() // } } return ; }
#include "decoder.h" #include "decoderlib.h" #include <algorithm> using namespace std; const int mxm = 1010; // struct we // { // int s1,s2,s3,s4; // }; int cou[mxm][10] = {},mat[10][10][10][10] = {}; int aru = 0,wal[mxm]= {},of2 = 0; int re2(int res,int dep) { int i,j,fn; if(dep == 4) { // for(i=0; i<4; i++) // { // hm[ru][i] = wa[i]; // } mat[wal[0]][wal[1]][wal[2]][wal[3]] = aru; aru++; return 0; } for(i=0; i<=res; i++) { wal[dep] = i; re2(res-i,dep+1); } return 0; } void decode(int n, int ll, int x[]) { int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192}; if(of2 == 0) { re2(7,0); } of2 = 1; sort(x,x+ll); for(i=0; i<256; i++) { for(j=0; j<4; j++) { cou[i][j] = 0; } } for(i=0; i<ll; i++) { cou[(x[i]>>2)][(x[i] & 3)] ++; } for(i=0; i<n; i++) { // cn = (i<<2); // cru = 0; output(mat[cou[i][0]][cou[i][1]][cou[i][2]][cou[i][3]]); // for(j=0; j<4; j++) // { // for(k=0; k<hm[mes[i]][j]; k++) // { // send(cn | j); // } // // cva[j] = ((mes[i] & dn[j]) >> (j*2)); // } // send(cn | cva[0]); // for(j=1; j<4; j++) // { // if() // } } return ; // int i, b; // for(i=0; i<L; i++) { // b = X[i]; // output(b); // } }

Compilation message (stderr)

encoder.cpp: In function 'int re(int, int)':
encoder.cpp:12:9: warning: unused variable 'j' [-Wunused-variable]
   12 |   int i,j,fn;
      |         ^
encoder.cpp:12:11: warning: unused variable 'fn' [-Wunused-variable]
   12 |   int i,j,fn;
      |           ^~
encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:31:13: warning: unused variable 'm' [-Wunused-variable]
   31 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |             ^
encoder.cpp:31:18: warning: unused variable 'cm' [-Wunused-variable]
   31 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                  ^~
encoder.cpp:31:21: warning: unused variable 'fn' [-Wunused-variable]
   31 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                     ^~
encoder.cpp:31:24: warning: unused variable 'fm' [-Wunused-variable]
   31 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                        ^~
encoder.cpp:31:27: warning: variable 'cru' set but not used [-Wunused-but-set-variable]
   31 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                           ^~~
encoder.cpp:31:31: warning: unused variable 'dn' [-Wunused-variable]
   31 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                               ^~

decoder.cpp: In function 'int re2(int, int)':
decoder.cpp:14:9: warning: unused variable 'j' [-Wunused-variable]
   14 |   int i,j,fn;
      |         ^
decoder.cpp:14:11: warning: unused variable 'fn' [-Wunused-variable]
   14 |   int i,j,fn;
      |           ^~
decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:34:11: warning: unused variable 'k' [-Wunused-variable]
   34 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |           ^
decoder.cpp:34:13: warning: unused variable 'm' [-Wunused-variable]
   34 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |             ^
decoder.cpp:34:15: warning: unused variable 'cn' [-Wunused-variable]
   34 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |               ^~
decoder.cpp:34:18: warning: unused variable 'cm' [-Wunused-variable]
   34 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                  ^~
decoder.cpp:34:21: warning: unused variable 'fn' [-Wunused-variable]
   34 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                     ^~
decoder.cpp:34:24: warning: unused variable 'fm' [-Wunused-variable]
   34 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                        ^~
decoder.cpp:34:27: warning: unused variable 'cru' [-Wunused-variable]
   34 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                           ^~~
decoder.cpp:34:31: warning: unused variable 'dn' [-Wunused-variable]
   34 |   int i,j,k,m,cn,cm,fn,fm,cru,dn[4] = {3,12,48,192};
      |                               ^~
#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...