제출 #1148993

#제출 시각아이디문제언어결과실행 시간메모리
1148993ali2241콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>
// #define int long long
#define arr2 array<int, 2>
#define arr3 array<int, 3>
#define all(a) a.begin(), a.end()
#define double long double
// #pragma GCC target("avx2")

using namespace std;

string s = "";
char chs[4] = {'A', 'B', 'X', 'Y'};

string guess_sequence(int n) {
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < chs.size(); ++j) {
            if (press(s + chs[j]) > s.size()) {
                s += chs[j];
                break;
            }
        }
    }
    return s;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:33: error: request for member 'size' in 'chs', which is of non-class type 'char [4]'
   17 |         for (int j = 0; j < chs.size(); ++j) {
      |                                 ^~~~