Submission #1308878

#TimeUsernameProblemLanguageResultExecution timeMemory
1308878sweetwibu2k8Coins (IOI17_coins)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define fi first #define se second #define pb push_back #define p_q priority_queue #define bit(n, i) (((n)>>(i))&1) #define all(x) x.begin(), x.end() typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,int> pli; typedef vector <vector <int> > vvi; const int M = 1e6 + 6; const int mod = 1e9 + 7; const int inf = 1e9 + 7; void maximize (int &a, int b) { if (a < b) a = b; } void minimize (int &a, int b) { if (a > b) a = b; } void add (int &a, int b) { a += b; if (a >= mod) a -= mod; } void del (int &a, int b) { a -= b; if (a < 0) a += mod; } int[] coin_flips (int[] b, int c) { int T = 0; for (int i = 0; i < 64; i ++) if (b[i] == 1) T ^= i; int id = T ^ c; return {id}; } int find_coin (int[] b) { int T = 0; for (int i = 0; i < 64; i ++) if (b[i] == 1) T ^= i; return T; }

Compilation message (stderr)

coins.cpp:26:4: error: structured binding declaration cannot have type 'int'
   26 | int[] coin_flips (int[] b, int c)
      |    ^~
coins.cpp:26:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
coins.cpp:26:4: error: empty structured binding declaration
coins.cpp:26:7: error: expected initializer before 'coin_flips'
   26 | int[] coin_flips (int[] b, int c)
      |       ^~~~~~~~~~
coins.cpp:35:22: error: expected ',' or '...' before 'b'
   35 | int find_coin (int[] b)
      |                      ^
coins.cpp: In function 'int find_coin(int*)':
coins.cpp:39:21: error: 'b' was not declared in this scope
   39 |                 if (b[i] == 1) T ^= i;
      |                     ^
grader.cpp: In function 'void shuffle(std::vector<int>&)':
grader.cpp:88:23: warning: 'void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   88 |         random_shuffle(v.begin(), v.end());
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61,
                 from grader.cpp:5:
/usr/include/c++/13/bits/stl_algo.h:4581:5: note: declared here
 4581 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~