제출 #133403

#제출 시각아이디문제언어결과실행 시간메모리
133403reda콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std ; string guess_sequence(int N) { if(N==3) { string ans=""; string use[4]={"A","B","X","Y"}; int g=-1; string t; for(int i=0;i<4;i++) { if(press(use[i])>g) { g=press(p); t=use[i]; } } ans+=t; string s=""; for(int i=0;i<4;i++) { if(use[i]==t)continue; s+=use[i]; } int i=0,pv=press(ans); while (ans.size()!=3) { string p; p=ans; p+=s[i]; int k =press(p); if(k>prev) { ans+=s[i]; } else i++; i=i%3; } return ans; } }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:25: error: 'p' was not declared in this scope
   17 |                 g=press(p);
      |                         ^
combo.cpp:35:17: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>'
   35 |             if(k>prev)
      |                ~^~~~~
combo.cpp:28:17: warning: unused variable 'pv' [-Wunused-variable]
   28 |         int i=0,pv=press(ans);
      |                 ^~
combo.cpp:44:1: warning: control reaches end of non-void function [-Wreturn-type]
   44 | }
      | ^