| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1345326 | nanaseyuzuki | 콤보 (IOI18_combo) | C++20 | 0 ms | 412 KiB |
#include <bits/stdc++.h>
#include "combo.h"
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
using namespace std;
#ifdef LOCAL
#include "C:\Users\Dell\Downloads\template\template\icpc-notebook\Utilities\debug.h"
#else
#define debug(...) 42
#endif
const int mn = 5e5 + 5, mod = 1e9 + 7, inf = 2e9;
string s, st;
// int press(string x) {
// int mx = 0;
// for(int i = 0; i < (int) x.size(); i++) {
// int cnt = 0;
// while(true) {
// if(x[i + cnt] == st[cnt] && cnt < (int)st.size() - 1 && i + cnt < (int)x.size() - 1) cnt ++;
// else {
// if((cnt == (int) st.size() - 1 || i + cnt == (int)x.size() - 1) && x[i + cnt] == st[cnt]) cnt ++;
// mx = max(mx, cnt);
// break;
// }
// debug(i, cnt, mx);
// }
// }
// debug(x, st, mx);
// return mx;
// }
string guess_sequence(int n) {
s.clear();
int num = press("AB");
char ban;
if(num >= 1) {
if(press("A") == 1) ban = 'A';
else ban = 'B';
}
else {
if(press("X") == 1) ban = 'X';
else ban = 'Y';
}
s += ban;
vector <char> all;
for(auto x : {'A', 'B', 'X', 'Y'}) {
if(x != ban) all.push_back(x);
}
for(int i = 1; i < n - 1; i++) {
string neww = s + all[0] + s + all[1] + all[0] + s + all[1] + all[1] + s + all[1] + all[2];
int z = press(neww);
if(z == i) s += all[2];
else if(z == i + 1) s += all[0];
else if(z == i + 2) s += all[1];
}
for(int i = 0; i <= 2; i++) {
if(press(s + all[i]) == n) return s + all[i];
}
}
// int main() {
// cin >> st;
// cout << guess_sequence(st.size()) << '\n';
// }
// Don't wanna lose anymore T_T
// Never let me go - Kazuo Ishiguro컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
