Submission #900283

#TimeUsernameProblemLanguageResultExecution timeMemory
900283Faisal_SaqibParrots (IOI11_parrots)C++17
Compilation error
0 ms0 KiB
#pragma once #include <map> #include <iostream> using namespace std; void encode(int n, int m[]) { for(int i=0;i<n;i++) { for(int j=0;j<8;j++) { if((m[i]&(1<<j))) { int l=0; for(int p=2;p>=0;p--) { l*=2; l+=(((j>>p)&1)); } for(int p=4;p>=0;p--) { l*=2; l+=((i>>p)&1); } send(l); } } } }
#pragma once #include <map> #include <iostream> using namespace std; void decode(int n, int l, int x[]) { map<int,int> cnt; for(int i=0;i<l;i++) { cnt[x[i]]++; } for(int i=0;i<n;i++) { int an=0; for(int j=0;j<8;j++) { int l=0; for(int p=2;p>=0;p--) { l*=2; l+=(((j>>p)&1)); } for(int p=4;p>=0;p--) { l*=2; l+=((i>>p)&1); } if(cnt.find(l)!=cnt.end()) { an+=(1<<j); } } output(an); } }

Compilation message (stderr)

encoder.cpp:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:24:5: error: 'send' was not declared in this scope
   24 |     send(l);
      |     ^~~~

decoder.cpp:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:33:3: error: 'output' was not declared in this scope
   33 |   output(an);
      |   ^~~~~~