제출 #1309136

#제출 시각아이디문제언어결과실행 시간메모리
1309136coderg콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include "combo.h" #include "bits/stdc++.h" using namespace std; string full="ABXY"; string guess_sequence(int N) { string ans="",s=""; ans+=press("AB")?press("A")?"A":"B":press("X")?"X":"Y"; for(char c:full){ if(c!=ans[0])s+=c; } F(i,1,N-1){ int send=press(ans+s[0]+s[0]+ans+s[0]+s[1]+ans+s[0]+s[2]+ans+s[1]); if(send==i)ans+=s[2]; else if(send==i+1)ans+=s[1]; else ans+=s[0]; } if(N>1){ if(press(ans+s[0])==N)ans+=s[0]; else if(press(ans+s[1])==N)ans+=s[1]; else ans+=s[2]; } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:5: error: 'i' was not declared in this scope
   13 |   F(i,1,N-1){
      |     ^
combo.cpp:13:3: error: 'F' was not declared in this scope
   13 |   F(i,1,N-1){
      |   ^