제출 #552288

#제출 시각아이디문제언어결과실행 시간메모리
552288pckien콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define vi vector<int> #define ii pair<int, int> #define vii vector<ii> #define pb push_back #define mp make_pair #define ff first #define ss second #define sz(a) (int)a.size() #define sci(a) scanf("%d", &a) #define scii(a, b) scanf("%d %d", &a, &b) #define pri(a) printf("%d ", a) #define pril(a) printf("%d\n", a) #define fto(i, a, b) for(int i = a; i <= b; ++i) #define fdto(i, a, b) for(int i = a; i >= b; --i) #define oo 1000000007 #define maxN 10005 using namespace std; string guess_sequence(int N) { string s; char mov[5]; mov[1] = 'X'; mov[2] = 'Y'; mov[3] = 'A'; mov[4] = 'B'; int cnt = 0; fto (i, 1, ) { fto (j, 1, 4) { s += mov[j]; int t = press(s); if (t > cnt) { cnt = t; break; } s.pop_back(); } } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:43: error: expected primary-expression before ';' token
   17 | #define fto(i, a, b) for(int i = a; i <= b; ++i)
      |                                           ^
combo.cpp:37:5: note: in expansion of macro 'fto'
   37 |     fto (i, 1, ) {
      |     ^~~
combo.cpp:41:21: error: 'press' was not declared in this scope
   41 |             int t = press(s);
      |                     ^~~~~