제출 #988698

#제출 시각아이디문제언어결과실행 시간메모리
988698Mighilon콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <combo.h> #include <bits/stdc++.h> using namespace std; string guess_sequence(int n){ string a="ABXY", b="AB", d, s; if(!press("AB")) d="XY"; char fc = b[0]; if(!press(string(1, fc))) fc=b[1]; trav(c, a) if(c!=fc) d+=c; s+=fc; if(n<=1) return s; while(sz(s)<n-1) s+=d[press(s+d[1]+s+d[2]+d[0]+s+d[2]+d[1]+s+d[2]+d[2])-sz(s)]; if(press(s+d[0]+s+d[1])>sz(s)){ if(press(s+d[0])) return s+d[0]; return s+d[1]; } return s+d[2]; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:10: error: 'c' was not declared in this scope; did you mean 'fc'?
   12 |     trav(c, a)
      |          ^
      |          fc
combo.cpp:12:5: error: 'trav' was not declared in this scope
   12 |     trav(c, a)
      |     ^~~~
combo.cpp:17:11: error: 'sz' was not declared in this scope; did you mean 's'?
   17 |     while(sz(s)<n-1)
      |           ^~
      |           s
combo.cpp:19:29: error: 'sz' was not declared in this scope; did you mean 's'?
   19 |     if(press(s+d[0]+s+d[1])>sz(s)){
      |                             ^~
      |                             s