제출 #164331

#제출 시각아이디문제언어결과실행 시간메모리
164331aggu_01000101Combo (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <string>
#include <unordered_map>
#include <cstring>
#include <chrono>
#include <vector>
#include <map>
#include <random>
#include <set>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <stdio.h>
#include <assert.h>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <deque>
#include <cassert>
#include <stack>
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
    char lol[] = {'A', 'B', 'X', 'Y'};
    int taken = 0;
    while(press("" + lol[taken])==0) taken++;
    string s = "" + lol[taken];
    for(int i = 1;i<n;i++){
        for(int j = 0;j<4;j++){
            if(j==taken) continue;
            int rn = press(s + lol[j]);
            if(rn==(i+1)){
                s = s+lol[j];
                j = 5;
            }
        }
    }
    return s;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:28:21: error: 'n' was not declared in this scope
   28 |     for(int i = 1;i<n;i++){
      |                     ^