제출 #552269

#제출 시각아이디문제언어결과실행 시간메모리
552269lethinh05콤보 (IOI18_combo)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define oo 1000000007 #define ll long long #define ld long double #define ii pair<int, int> #define pll pair<ll, ll> #define ff first #define ss second #define mp make_pair #define vi vector<int> #define vii vector<ii> #define sz(a) (int)(a.size()) #define pb push_back #define fto(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i) #define fdto(i, a, b) for (int i = (int)(a); i >= (int)(b); --i) #define bug(x) "["#x" = "<<(x)<<"] " #define maxN 100005 using namespace std; char chrs[] = {'A', 'B', 'X', 'Y'}; int press(string p); #ifdef LOCALME int press(string p) { cout << p << "\n"; fflush(stdout); int x; cin >> x; return x; } #endif // LOCALME string guess_sequence(int n) { string s = ""; fto(i, 0, 3) { string p(1, chrs[i]); int matches = press(p); if (matches == 1) { s += chrs[i]; break; } } fto(i, 1, n-1) { fto(i, 0, 3) { string p = s + chrs[i]; int matches = press(p); if (matches == sz(p)) { s += chrs[i]; break; } } } return s; } int main() { #ifdef LOCALME int n; cin >> n; string res = guess_sequence(n); cout << res << "\n"; #endif return 0; }

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

/usr/bin/ld: /tmp/ccgLaYVG.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccq84YaH.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status