제출 #1141933

#제출 시각아이디문제언어결과실행 시간메모리
1141933FZ_LaabidiCombo (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { if(N==3){ vector<string> u={"A", "B", "X", "Y"}; int coin = 0, k=1; while(coin==0){ coin = press(u[i]); k++; } k--; string p = ""; p+=(u[k]); u[i]="1"; sort(u.begin(), u .end()); for(int i=1; i<N; i++){ for(int j = 1; j<4; j++){ coin =press(p+u[j]); if(coin==i)continue; p+=u[j]; break; } } return p; } }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:28: error: 'i' was not declared in this scope
   11 |             coin = press(u[i]);
      |                            ^
combo.cpp:17:11: error: 'i' was not declared in this scope
   17 |         u[i]="1";
      |           ^
combo.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^