답안 #704912

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
704912 2023-03-03T06:43:07 Z cig32 The Collection Game (BOI21_swaps) C++17
컴파일 오류
0 ms 0 KB
#include "swaps.h"
#include "bits/stdc++.h"
using namespace std;

void solve(int N, int V) {
  // TODO implement this function
  for(int i=1; i<=9; i++) {
    for(int j=(1 << ((int) log2(N))); j>=1; j>>=1) {
      int count = 0;
      for(int k=1; k<=N; k+=(j<<1)) {
        for(int l=k; l<k+j; l++) {
          if((k<<1) + (j<<1) - 1 - l <= N) {
            count++;
            schedule(l, k + k+(j<<1)-1 - l);
          }
        }
      }
      if(!count) continue;
      vector<int> uni = visit();
      for(int k=1; k<=N; k++) cout << A[k] << " \n"[k == N];
    }
  }
  vector<int> identity;
  for(int i=1; i<=N; i++) identity.push_back(i);
  answer(identity);
}

Compilation message

swaps.cpp: In function 'void solve(int, int)':
swaps.cpp:20:39: error: 'A' was not declared in this scope
   20 |       for(int k=1; k<=N; k++) cout << A[k] << " \n"[k == N];
      |                                       ^