| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1073645 | HorizonWest | 콤보 (IOI18_combo) | C++17 | 1 ms | 600 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include <iostream>
#include <complex>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <functional>
#include <bitset>
#include <queue>
#include <map>
#include <stack>
#include <cmath>
#include <cstdint>
using namespace std;
#define endl '\n'
#define db double
#define ll long long
#define pb push_back
#define fs first
#define sd second
#define Mod long(1e9 + 7)
#define all(x) x.begin(), x.end()
#define unvisited long(-1)
#define Eps double(1e-9)
#define _for(i, n) for(int i = 0; i < (n); i++)
#define dbg(x) cout << #x ": " << x << endl;
const int Max = 1e6 + 7, Inf = 1e9 + 7;
string C[] = { "A", "B", "X", "Y" };
string query(int n, string s)
{
vector <string> op;
for(int i = 0; i < 4; i++){
if(s[0] != C[i][0]) op.push_back(C[i]);
}
string q = s + op[0];
for(int i = 0; i < 4; i++){
if(s[0] != C[i][0]) q += s + op[1] + C[i];
}
int l = s.size(), t = press(q);
if(t == l){
return op[2];
}else if(t == l+1){
return op[0];
}else
return op[1];
}
string ini(int n, string s){
string a = s + C[0] + s + C[1];
if(press(a)){
if(press(s + C[0])){
return C[0];
}else return C[1];
} else {
if(press(s + C[2])){
return C[2];
}else return C[3];
}
}
string guess_sequence(int N)
{
string s = ini(N, s);
while (s.size() < N){
if(s.size() == N-1)
s += ini(N, s);
else
s += query(N, s);
}
return s;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
