제출 #314253

#제출 시각아이디문제언어결과실행 시간메모리
314253Vladth11콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define debug(x) cerr << #x << " " << x << "\n" #define debug_with_space(x) cerr << #x << " " << x << " " using namespace std; typedef long long ll; typedef pair <int, int> pii; typedef pair <int, pii> piii; const ll NMAX = 200001; const ll INF = (1 << 30); const ll MOD = 1000000007; const ll BLOCK = 101; const ll nr_of_bits = 18; char ch[] = {'A', 'B', 'X', 'Y'}; int viz[5]; string guess_sequence(int N){ string s = ""; for(int i = 0; i < 4; i++) viz[i] = 0; if(press("AB")){ if(press("A")){ s += "A"; viz[0] = 1; }else{ s += "B"; viz[1] = 1; } }else{ if(press("X")){ s += "X"; viz[2] = 1; }else{ s += "Y"; viz[3] = 1; } } for(int i = 2; i < N; i++){ string intrb = ""; int cnt = 2; char a ; char b; char cc; for(int i = 0; i < 4; i++){ if(!viz[i] && cnt == 2){ intrb += s; a = ch[i]; intrb += ch[i]; cnt--; }else if(!viz[i] && cnt == 1){ b = ch[i]; for(int x = 0; x < 4; x++){ if(!viz[x]){ intrb += s; intrb += ch[i]; intrb += ch[x]; } } cnt--; }else if(!viz[i]){ cc = ch[i]; } } int ras = press(intrb); if(ras == i){ s += a; }else if(ras == i + 1){ s += b; }else{ s += cc; } } char a, b, cc; int cnt = 3; for(int i = 0; i < 4; i++){ if(!viz[i] && cnt == 3){ a = ch[i]; }else if(!viz[i] && cnt == 2){ b = ch[i]; }else if(!viz[i]){ cc = ch[i]; } } string intrb = ""; intrb += s; if(press((intrb + a)) == N){ s += a; }else if(press((intrb + b)) == N){ s += b; }else{ s += cc; } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:8: error: 'press' was not declared in this scope
   23 |     if(press("AB")){
      |        ^~~~~
combo.cpp:66:19: error: 'press' was not declared in this scope
   66 |         int ras = press(intrb);
      |                   ^~~~~
combo.cpp:88:8: error: 'press' was not declared in this scope
   88 |     if(press((intrb + a)) == N){
      |        ^~~~~