제출 #1007906

#제출 시각아이디문제언어결과실행 시간메모리
1007906Faggi앵무새 (IOI11_parrots)C++11
52 / 100
2 ms1488 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]){ int pos=0,par=0,cad=0,k,i,j, nK,ag=0,c,pot; vector<int>v(8,0); for(i=0; i<N; i++) { par=0; cad=0; k=0; ag=0; k=i; pot=1; for(j=0; j<8; j++) { if((M[i]&pot)>0) v[j]=1; else v[j]=0; pot*=2; } for(j=0; j<4; j++) { nK=k; nK=nK<<2; nK+=j; for(c=ag; c<ag+2; c++) { nK=nK<<1; if(v[c]==1) nK++; } send(nK); ag+=2; } pos++; }}
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]){ int i,j,a,b,pos,par,num; vector<vector<vector<int>>>v(N,vector<vector<int>>(4,vector<int>(2,0))); for(i=0; i<L; i++) { a=0; b=0; pos=X[i]>>4; par=(X[i]^(pos<<4))>>2; if((X[i]&2)>0) a=1; if((X[i]&1)>0) b=1; v[pos][par][0]=a; v[pos][par][1]=b; } for(i=0; i<N; i++) { num=0; for(j=3; j>=0; j--) { a=v[i][j][0]; b=v[i][j][1]; num=num<<1; num+=b; num=num<<1; num+=a; } output(num); }}

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

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:5:43: warning: variable 'par' set but not used [-Wunused-but-set-variable]
    5 | void encode(int N, int M[]){    int pos=0,par=0,cad=0,k,i,j, nK,ag=0,c,pot;    vector<int>v(8,0);    for(i=0; i<N; i++)    {        par=0;        cad=0;        k=0;        ag=0;        k=i;        pot=1;        for(j=0; j<8; j++)        {            if((M[i]&pot)>0)                v[j]=1;            else                v[j]=0;            pot*=2;        }        for(j=0; j<4; j++)        {            nK=k;            nK=nK<<2;            nK+=j;            for(c=ag; c<ag+2; c++)            {                nK=nK<<1;                if(v[c]==1)                    nK++;            }            send(nK);            ag+=2;        }        pos++;    }}
      |                                           ^~~
encoder.cpp:5:49: warning: variable 'cad' set but not used [-Wunused-but-set-variable]
    5 | void encode(int N, int M[]){    int pos=0,par=0,cad=0,k,i,j, nK,ag=0,c,pot;    vector<int>v(8,0);    for(i=0; i<N; i++)    {        par=0;        cad=0;        k=0;        ag=0;        k=i;        pot=1;        for(j=0; j<8; j++)        {            if((M[i]&pot)>0)                v[j]=1;            else                v[j]=0;            pot*=2;        }        for(j=0; j<4; j++)        {            nK=k;            nK=nK<<2;            nK+=j;            for(c=ag; c<ag+2; c++)            {                nK=nK<<1;                if(v[c]==1)                    nK++;            }            send(nK);            ag+=2;        }        pos++;    }}
      |                                                 ^~~
#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...