Submission #707635

#TimeUsernameProblemLanguageResultExecution timeMemory
707635Nhoksocqt1Parrots (IOI11_parrots)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define inf 0x3f3f3f3f #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #define sz(x) int((x).size()) #define fi first #define se second typedef long long ll; typedef pair<int, int> ii; template<class X, class Y> inline bool maximize(X &x, const Y &y) {return (x < y ? x = y, 1 : 0);} template<class X, class Y> inline bool minimize(X &x, const Y &y) {return (x > y ? x = y, 1 : 0);} mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int Random(int l, int r) { return uniform_int_distribution<int>(l, r)(rng); } //#define Nhoksocqt1 #ifdef Nhoksocqt1 vector<int> encoder, token; void send(int a) { assert(a >= 0 && a <= 65535); encoder.push_back(a); } void output(int b) { token.push_back(b); } #endif // Nhoksocqt1 void encode(int N, int M[]) { for (int i = 0; i < N; ++i) send((M[i] << 4) ^ i); } void decode(int N, int L, int X[]) { for (int i = 0; i < N; ++i) { for (int j = 0; j < L; ++j) { if((X[i] & ((1 << 4) - 1)) == j) { output(X[i] >> 4); break; } } } } #ifdef Nhoksocqt1 int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("PARROTS.inp", "r", stdin); freopen("PARROTS.out", "w", stdout); encoder.clear(), token.clear(); int m[70], L[500], n; cin >> n; for (int i = 0; i < n; ++i) { cin >> m[i]; m[i] = Random(0, 255); cout << m[i] << " \n"[i + 1 == n]; } encode(n, m); cout << "NUMBER BIRD: " << sz(encoder) << '\n'; for (int it = 0; it < sz(encoder); ++it) L[it] = encoder[it]; decode(n, sz(encoder), L); cout << "TOKEN GET: " << sz(token) << '\n'; assert(sz(token) == n); for (int it = 0; it < n; ++it) assert(token[it] == m[it]); return 0; } #endif // Nhoksocqt1

Compilation message (stderr)

encoder.cpp:6: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    6 | #pragma GCC optimization ("O3")
      | 
encoder.cpp:7: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    7 | #pragma GCC optimization ("unroll-loops")
      | 
encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:43:9: error: 'send' was not declared in this scope
   43 |         send((M[i] << 4) ^ i);
      |         ^~~~
encoder.cpp: In function 'void decode(int, int, int*)':
encoder.cpp:50:17: error: 'output' was not declared in this scope
   50 |                 output(X[i] >> 4);
      |                 ^~~~~~

/usr/bin/ld: /tmp/cc2e2Mrc.o: in function `main':
grader_decoder.cpp:(.text.startup+0x1ef): undefined reference to `decode(int, int, int*)'
collect2: error: ld returned 1 exit status