Submission #704874

# Submission time Handle Problem Language Result Execution time Memory
704874 2023-03-03T06:17:33 Z cig32 The Collection Game (BOI21_swaps) C++17
Compilation error
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<=10; i++) {
    for(int j=(1 << ((int) log2(N))); j>=1; j>>=1) {
      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) schedule(k + k+(j<<1)-1 - l, l);
        }
      }
      vector<int> uni = visit();
    }
    for(int j=2; j+1<=N; j+=2) {
      schedule(j+1,j);
    }
    vector<int> uni = visit();
  }
  for(int i=1; i<=N; i++) cout << A[i] << " \n"[i == 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:21:35: error: 'A' was not declared in this scope
   21 |   for(int i=1; i<=N; i++) cout << A[i] << " \n"[i == N];
      |                                   ^