| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 228376 | hhh07 | 콤보 (IOI18_combo) | C++14 | 177 ms | 768 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
#include "combo.h"
using namespace std;
string rez(string s, int x){
string y = "";
for (int i = 0; i < x; i++)
y += s[i];
return y;
}
string maks(string a, string b, string x, string y, string curr){
if (a.length() > curr.length())
return a;
if (b.length() > curr.length())
return b;
if (x.length() > curr.length())
return x;
return y;
}
string guess_sequence(int n){
string curr = "";
while(curr.length() < n){
string a = rez(curr + 'A', press(curr + 'A'));
string x = rez(curr + 'X', press(curr + 'X'));
string y = rez(curr + 'Y', press(curr + 'Y'));
string b = rez(curr + 'B', press(curr + 'B'));
curr = maks(a, b, x, y, curr);
if (curr.length() == n)
return curr;
}
return curr;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
