제출 #1289984

#제출 시각아이디문제언어결과실행 시간메모리
1289984oruc콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
/// designed by Oruc Cabbarli

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include "combo.h"


using namespace std;
using namespace __gnu_pbds;

#define int long long
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pii>
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(), v.end()
#define endl '\n'
#define is tree<int, nuint_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

mt19937 rng(chrono::steady_clock().now().time_since_epoch().count());

template<typename T>void show(vector<T> &v){
    for(auto &i: v){
        cout << i << ' ';
    }
    cout << endl;
}



string guess_sequence(int N){
    int ab = press("AB");
    int ax = press("AX");
    string ans;
    if(ab == 0){
        if(ax == 0){
            ans = "Y";
        }
        else if(ax == 1){
            ans = "X";
        }
        else{
            ans = "A";
        }
    }
    else if(ab == 1){
        if(ax == 0){
            ans = "B";
        }
        else if(ax == 1){
            ans = "A";
        }
        else{
            ans = "A";
        }
    }
    else{
        ans = "A";
    }

    char ilk = ans[0];
    for(int i = 2; i <= N; i++){
        for(char j: {'A','B','X','Y'}){
            if(j == ilk) continue;
            int ok = press(ans+j);
            if(ok == ans.size()+1){
                ans += j;
                break;
            }
        }
    }
    //cout << ans << endl;
    return ans;
}

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

/usr/bin/ld: /tmp/cc0uThXs.o: in function `main':
grader.cpp:(.text.startup+0x4b): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status