제출 #167129

#제출 시각아이디문제언어결과실행 시간메모리
167129minseo852콤보 (IOI18_combo)C++11
5 / 100
3 ms256 KiB
#include <combo.h> #include<string> #include <vector> using namespace std; #define t press string guess_sequence(int N) { std::string r, p, o = "ABXY"; int i, j, c; int a = 0, b = 0, d = 0; r = t("AB") ? t("A") ? "A" : "B" : t("X") ? "X" : "Y"; for (i = 0; i < 4; i++)if (o[i] == r[0]){ o.erase(o.begin() + i); break; } for (int i = 1; i < N - 1; i++) { p = r + o[0] + r + o[1] + o[0] + r + o[1] + o[1] + r + o[1] + o[2]; c = press(p); if (c == i) r += o[2]; else if (c == i + 1) r += o[0]; else r += o[1]; } if (press(r + o[0] + r + o[1]) == N) { r += (press(r + o[0]) == N ? o[0] : o[1]); } else r += o[2]; return r; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:9: warning: unused variable 'j' [-Wunused-variable]
    9 |  int i, j, c;
      |         ^
combo.cpp:10:6: warning: unused variable 'a' [-Wunused-variable]
   10 |  int a = 0, b = 0, d = 0;
      |      ^
combo.cpp:10:13: warning: unused variable 'b' [-Wunused-variable]
   10 |  int a = 0, b = 0, d = 0;
      |             ^
combo.cpp:10:20: warning: unused variable 'd' [-Wunused-variable]
   10 |  int a = 0, b = 0, d = 0;
      |                    ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...