| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 425738 | dxz05 | 크레이피쉬 글쓰는 기계 (IOI12_scrivener) | C++14 | 1090 ms | 2432 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 3e2;
int commands;
int prv[N];
bool ok[N];
char ch[N];
void dbg(){
return;
for (int i = 0; i < commands; i++) cout << ch[i] << ' '; cout << endl;
for (int i = 0; i < commands; i++) cout << ok[i] << ' '; cout << endl;
cout << endl;
}
void Init() {
commands = 0;
fill(ch, ch + N, '?');
}
void TypeLetter(char L) {
ok[commands] = true;
prv[commands] = 1e9;
ch[commands] = L;
commands++;
dbg();
}
vector<int> undo;
void UndoCommands(int U) {
ok[commands] = true;
prv[commands] = commands - U;
undo.push_back(commands);
for (int i = undo.size() - 1; i >= 0; i--){
int j = undo[i];
if (j >= prv[commands]) prv[commands] = min(prv[commands], prv[j]);
}
for (int i = prv[commands]; i < commands; i++) ok[i] ^= 1;
commands++;
dbg();
}
char GetLetter(int P) {
char ans = '?';
for (int i = 0; i < commands; i++){
if (ok[i] && ch[i] != '?'){
if (P == 0){
ans = ch[i];
break;
}
P--;
}
}
dbg();
return ans;
}
/**
14
T a
T b
P 1
T d
U 2
U 1
P 2
T e
U 1
U 5
T c
P 2
U 2
P 2
*/
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
