제출 #1344837

#제출 시각아이디문제언어결과실행 시간메모리
1344837nanaseyuzuki동굴 (IOI13_cave)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
using namespace std;

#ifdef LOCAL
#include "C:\Users\Dell\Downloads\template\template\icpc-notebook\Utilities\debug.h"
#else
#define debug(...) 42
#endif

const int mn = 5e5 + 5, mod = 1e9 + 7, inf = 2e9;

void exploreCave(int n) {
    int s[n] = {0}, d[n] = {0}, on[n] = {0}, c[n];

    for(int i = 0; i < n; i++) {
        int all = tryCombination(s);
        // for(int i = 0; i < n; i++) cout << s[i] << ' ';
        // cout << '\n';
        // cout << "All " << all << '\n';
        if(all == i) {
            for(int j = 0; j < n; j++) {
                if(on[j]) continue;
                s[j] ^= 1;
                int cur = tryCombination(s);
                if(cur != i) {
                    c[i] = j;
                    break;
                }
            }
            
            for(int j = 0; j < c[i]; j++) {
                if(on[j]) continue;
                s[j] ^= 1;
            } 
        }
        else if(all != i) {
            for(int j = 0; j < n; j++) {
                if(on[j]) continue;
                s[j] ^= 1;
                int cur = tryCombination(s);
                if(cur == i) {
                    c[i] = j;
                    break;
                }
            }
            
            for(int j = 0; j <= c[i]; j++) {
                if(on[j]) continue;
                s[j] ^= 1;
            }
        }
        d[c[i]] = i;
        // cout << "c[i] = " << c[i] << '\n';
        on[c[i]] = 1;
    }

    answer(s, d);
}
// Don't wanna lose anymore T_T
// Never let me go - Kazuo Ishiguro

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:21:19: error: 'tryCombination' was not declared in this scope
   21 |         int all = tryCombination(s);
      |                   ^~~~~~~~~~~~~~
cave.cpp:62:5: error: 'answer' was not declared in this scope
   62 |     answer(s, d);
      |     ^~~~~~