Submission #795026

#TimeUsernameProblemLanguageResultExecution timeMemory
795026ono_de206Parrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
#include "encoder.h" #include "encoderlib.h" #include<bits/stdc++.h> using namespace std; #define in insert #define all(x) x.begin(),x.end() #define pb push_back #define eb emplace_back #define ff first #define ss second //#define int long long typedef long long ll; typedef vector<int> vi; typedef set<int> si; typedef multiset<int> msi; typedef pair<int, int> pii; typedef vector<pii> vpii; void encode(int n, int a[]) { vector<int> ret(10 * n); for(int i = 0; i < n; i++) { for(int j = 0; j < 8; j++) { if((a[i] >> j) & 1) { send(i | (j << 5)); } } } }
#include "decoder.h" #include "decoderlib.h" #include<bits/stdc++.h> using namespace std; #define in insert #define all(x) x.begin(),x.end() #define pb push_back #define eb emplace_back #define ff first #define ss second //#define int long long typedef long long ll; typedef vector<int> vi; typedef set<int> si; typedef multiset<int> msi; typedef pair<int, int> pii; typedef vector<pii> vpii; void decode(int n, int l, int x[]) { vector<int> ret(n); for(int i = 0; i < l; i++) { int id = x & 31; int pos = x >> 5; ret[id] |= 1 << pos; } for(int i = 0; i < n; i++) { output(ret[i]); } }

Compilation message (stderr)

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:25:14: error: invalid operands of types 'int*' and 'int' to binary 'operator&'
   25 |   int id = x & 31;
      |            ~ ^ ~~
      |            |   |
      |            |   int
      |            int*
decoder.cpp:26:15: error: invalid operands of types 'int*' and 'int' to binary 'operator>>'
   26 |   int pos = x >> 5;
      |             ~ ^~ ~
      |             |    |
      |             int* int