Submission #61803

# Submission time Handle Problem Language Result Execution time Memory
61803 2018-07-26T18:11:24 Z theknife2001 Crayfish scrivener (IOI12_scrivener) C++17
12 / 100
1000 ms 2172 KB
#include <bits/stdc++.h>
#define ii pair < char , char >
#define fi first
#define se second


using namespace std;
const int N=1e6+5;
ii a[N];
char s[N];
int cnt;
int i;


void Init() {}

void TypeLetter(char L) {
    a[i].fi='T';
    a[i].se=L;
    i++;
}

void UndoCommands(int U) {
    a[i].fi='U';
    a[i].se='0'+U;
    i++;
}

char GetLetter(int P) {
    if(cnt==0)
    {
        int j=0;
        for(int k=i-1;k>=0;k--)
        {
            if(a[k].fi=='T')
            {
                s[j]=a[k].se;
                j++;
            }
            else
            {
                k-=(a[k].se-'0');
            }
        }
        reverse(s,s+j);
    }
    return s[P];
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 4 ms 488 KB Output is correct
3 Correct 3 ms 520 KB Output is correct
4 Correct 3 ms 520 KB Output is correct
5 Correct 3 ms 660 KB Output is correct
6 Correct 3 ms 660 KB Output is correct
7 Correct 3 ms 660 KB Output is correct
8 Correct 3 ms 660 KB Output is correct
9 Correct 3 ms 660 KB Output is correct
10 Correct 3 ms 660 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 660 KB Output is correct
2 Correct 3 ms 660 KB Output is correct
3 Correct 5 ms 776 KB Output is correct
4 Correct 3 ms 776 KB Output is correct
5 Correct 3 ms 776 KB Output is correct
6 Correct 3 ms 776 KB Output is correct
7 Correct 3 ms 776 KB Output is correct
8 Correct 3 ms 776 KB Output is correct
9 Correct 3 ms 776 KB Output is correct
10 Correct 3 ms 776 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1081 ms 776 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1056 ms 2172 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1078 ms 2172 KB Time limit exceeded
2 Halted 0 ms 0 KB -