# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
99123 | JustasLe | 콤보 (IOI18_combo) | C++17 | 74 ms | 456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int N) {
set<char> X = {'A', 'B', 'X', 'Y'};
string s = "";
for (auto it = X.begin(); it != X.end(); it++) {
int x = press(s + *it);
if (x != 0) {
s += *it;
X.erase(it);
break;
}
}
if (s == "") {
return s;
}
int prev = 1;
bool ok = true;
string e = "";
while (ok) {
ok = false;
int sz = (int) s.size(), esz = (int) e.size();
for (auto it = X.begin(); it != X.end(); it++) {
// if ((N - 1) % esz == 0 && (N - 1) / esz > 1) {
// int x = press(s + e);
// if (x > prev) {
// for (int j = 0; j < x - prev; j++) {
// s += e[j];
// }
// prev = x;
// ok = true;
// break;
// }
// }
string poss = s + *it;
int d = N - sz;
string t = "";
for (int j = 0; j < d; j++) {
t += *it;
}
int x = press(s + t);
if (x > prev) {
for (int j = 0; j < x - prev; j++) {
e += *it;
s += *it;
}
ok = true;
prev = x;
break;
}
}
}
return s;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |