Submission #351867

#TimeUsernameProblemLanguageResultExecution timeMemory
351867juggernautParrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
#include"encoder.h" #include"encoderlib.h" #include<bits/stdc++.h> using namespace std; void encode(int n,int a[]){ int xor=0; if(n<=32){ for(int i=0;i<n;i++) for(int j=0;j<8;j++) if(a[i]>>j&1) send((i<<3)|j); }else{ for(int i=0;i<n;i++){ a[i]^=xor; while(a[i]>63)send((i<<2)|3),a[i]-=64; while(a[i]>15)send((i<<2)|2),a[i]-=16; while(a[i]>3)send((i<<2)|1),a[i]-=4; while(a[i]>0)send((i<<2)|0),a[i]-=1; } } }
#include"decoder.h" #include"decoderlib.h" #include<bits/stdc++.h> using namespace std; int res[64]; void decode(int n,int m,int a[]){ int xor=0; for(int i=0;i<n;i++)res[i]=0; if(n<=32){ for(int i=0;i<m;i++)res[a[i]>>3]|=(1<<(a[i]&7)); }else{ for(int i=0;i<m;i++){ int data=a[i]&3; if(data==0)res[a[i]>>2]+=1; if(data==1)res[a[i]>>2]+=4; if(data==2)res[a[i]>>2]+=16; if(data==3)res[a[i]>>2]+=64; } for(int i=0;i<n;i++)res[i]^=xor; } for(int i=0;i<n;i++)output(res[i]); }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:6:9: error: expected unqualified-id before 'xor' token
    6 |     int xor=0;
      |         ^~~
encoder.cpp:14:19: error: expected primary-expression before 'xor' token
   14 |             a[i]^=xor;
      |                   ^~~
encoder.cpp:14:22: error: expected primary-expression before ';' token
   14 |             a[i]^=xor;
      |                      ^

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:7:9: error: expected unqualified-id before 'xor' token
    7 |     int xor=0;
      |         ^~~
decoder.cpp:19:37: error: expected primary-expression before 'xor' token
   19 |         for(int i=0;i<n;i++)res[i]^=xor;
      |                                     ^~~
decoder.cpp:19:40: error: expected primary-expression before ';' token
   19 |         for(int i=0;i<n;i++)res[i]^=xor;
      |                                        ^