Submission #534783

#TimeUsernameProblemLanguageResultExecution timeMemory
534783NhatMinh0208The Collection Game (BOI21_swaps)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "swaps.h" void solve(int n, int v) { vector<int> sus; vector<int> res; for (int i=1;i<=n;i++) sus.push_back(i); for (int t=0;t<9;t++) for (int k=t;k>=0;k--) { { for (int i=0;i<n;i++) if ((((i>>k)&1)==(k-t!=0)) && (i+(1<<k)<n) && (((i+(1<<k))>>(t+1))==(i>>(t+1)))) { schedule(sus[i],sus[i+(1<<k)]); } res=visit(); int j=0; for (int i=0;i<n;i++) if ((((i>>k)&1)==(k-t!=0)) && (i+(1<<k)<n) && (((i+(1<<k))>>(t+1))==(i>>(t+1)))) { if (res[j]==0) swap(sus[i],sus[i+(1<<k)]); j++; } } } } answer(sus); }

Compilation message (stderr)

swaps.cpp:25:8: error: expected constructor, destructor, or type conversion before '(' token
   25 |  answer(sus);
      |        ^
swaps.cpp:26:1: error: expected declaration before '}' token
   26 | }
      | ^