답안 #534783

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
534783 2022-03-09T01:16:12 Z NhatMinh0208 The Collection Game (BOI21_swaps) C++14
컴파일 오류
0 ms 0 KB
#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

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 | }
      | ^