| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 395104 | jeroenodb | 콤보 (IOI18_combo) | C++14 | 1 ms | 200 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include "bits/stdc++.h"
using namespace std;
#define all(x) begin(x),end(x)
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { string sep; for (const T &x : v) os << sep << x, sep = " "; return os; }
#define debug(a) cerr << "(" << #a << ": " << a << ")\n";
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
const int mxN = 1e5+1, oo = 1e9;
std::string guess_sequence(int N) {
int n = N;
string but = "ABXY";
if(press("AB")) {
swap(but[press("B")], but[0]);
} else {
swap(but[press("D")+2], but[0]);
}
string pref;
pref+=but[0];
for(int i=1;i<n-1;++i) {
string query = pref+but[1];
for(int j=1;j<4;++j) {
query+=pref+but[2]+but[j];
}
int coins = press(query);
if(coins == pref.size()) {
pref+=but[3];
} else if(coins == pref.size()+1) {
pref+=but[1];
} else {
pref+=but[2];
}
}
// check last character
random_shuffle(but.begin()+1, but.end());
if(press(pref+but[1]+pref+but[2])==n) {
if(press(pref+but[1])) {
pref+=but[1];
} else pref+=but[2];
} else pref+=but[3];
return pref;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
