제출 #1207734

#제출 시각아이디문제언어결과실행 시간메모리
1207734jasonicThe Collection Game (BOI21_swaps)C++20
컴파일 에러
0 ms0 KiB
#include "swaps.h"
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define fastIO cin.tie(0); ios::sync_with_stdio(false)

vector<int> a;

void swapBig(int i, int j) {
    schedule(i, j);
    visit();
    // we dont care abt output of visit since 
}

void solve(int N, int V) {
    a = vector<int>(N);
    for(int i = 0; i < N; i++) a[i] = i+1;

    // bubble sort? N^2/2 works for st3 60%...

    for(int i = n-1; i > 0; i--) {
        for(int j = 0; j < i; j++) {
            swapBig(i, j);
        }
    }

    answer(a);
}

컴파일 시 표준 에러 (stderr) 메시지

swaps.cpp: In function 'void solve(int, int)':
swaps.cpp:22:17: error: 'n' was not declared in this scope
   22 |     for(int i = n-1; i > 0; i--) {
      |                 ^