Submission #620076

#TimeUsernameProblemLanguageResultExecution timeMemory
620076nohaxjustsofloCoins (IOI17_coins)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update> order_set; mt19937 mt_rand(chrono::high_resolution_clock::now().time_since_epoch().count()); //uniform_int_distribution<int> gen; ///(min, max) //int random() {return gen(mt_rand);} const int mxN=3e5+5; const int mod=998244353; const int mxlogN=20; const int mxK=26; const int inf=2e9; const int K=600; int[] coin_flips(int[] b, int c) { int xr=c; for(int i=0; i<64; i++) if(b[i]) xr^=i; b[xr]^=1; } int find_coin(int[] b) { int xr=0; for(int i=0; i<64; i++) if(b[i]) xr^=i; return xr; } /* int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for(int i=0; i<n; i++) dp[0][i]=dp[1][i]=-1; for(int i=1; i<n; i++) { int u,v; cin >> u >> v; u--, v--; adj[u].push_back(v); adj[v].push_back(u); } cin >> s; cout << solve(0,0,0) << "\n"; } */

Compilation message (stderr)

coins.cpp:20:4: error: structured binding declaration cannot have type 'int'
   20 | int[] coin_flips(int[] b, int c)
      |    ^~
coins.cpp:20:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
coins.cpp:20:4: error: empty structured binding declaration
coins.cpp:20:7: error: expected initializer before 'coin_flips'
   20 | int[] coin_flips(int[] b, int c)
      |       ^~~~~~~~~~
coins.cpp:26:21: error: expected ',' or '...' before 'b'
   26 | int find_coin(int[] b)
      |                     ^
coins.cpp: In function 'int find_coin(int*)':
coins.cpp:29:32: error: 'b' was not declared in this scope
   29 |     for(int i=0; i<64; i++) if(b[i]) xr^=i;
      |                                ^