| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 792823 | fatemetmhr | 콤보 (IOI18_combo) | C++17 | 1 ms | 208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// Be name khode //
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define all(x) x.begin(), x.end()
#define pb push_back
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
const int maxn5 = 5e5 + 10;
const int lg = 20;
string s[4];
char a[4];
std::string guess_sequence(int n) {
string c[4] = {"A", "B", "X", "Y"};
shuffle(c, c + 4, rng);
if(press(c[0]))
s[0] = s[1] = s[2] = s[3] = c[0];
else if(press(c[1]))
s[0] = s[1] = s[2] = s[3] = c[1];
else if(press(c[2]))
s[0] = s[1] = s[2] = s[3] = c[2];
else if(press(c[3]))
s[0] = s[1] = s[2] = s[3] = c[3];
for(int i = 0; i < 4; i++)
a[i] = c[i][0];
while(s[0].size() < n){
int keep = s[0].size();
for(int i = 0; i < 4; i++)
while(s[i].size() < n)
s[i].pb(a[rng() % 4]);
string t = s[0] + s[1] + s[2] + s[3];
int k = press(t);
for(int i = 0; i < 4; i++)
while(s[i].size() > k)
s[i].pop_back();
if(k == keep || rng() % 20 == 0){
int mx = 0, val = 0;
for(int i = 0; i < 4; i++){
int w = press(s[i]);
if(w >= val){
mx = i;
val = w;
}
}
for(int i = 0; i < 4; i++)
s[i] = s[mx];
}
}
shuffle(s, s + 4, rng);
for(int i = 0; i < 4; i++)
if(press(s[i]) == n)
return s[i];
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
