Submission #61819

# Submission time Handle Problem Language Result Execution time Memory
61819 2018-07-26T18:32:10 Z theknife2001 Crayfish scrivener (IOI12_scrivener) C++17
0 / 100
179 ms 3932 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];
bool q=0;
int i=0;


void Init() {}

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

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

int j=0;

char GetLetter(int P) {
    if(!q)
    {
        j=0;
        i--;
        while(i>=0)
        {
            if(a[i].fi=='T')
            {
                s[j]=a[i].se;
                j++;
            }
            else if(a[i].fi=='F')
            {
                i-=(a[i].se-'0');
            }
            else
            {
                if(a[i].fi==0)
                    assert(0);
            }
            i--;
        }
        reverse(s,s+j);
    }
    q=1;
    return s[P];
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Incorrect 3 ms 464 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 464 KB Output is correct
2 Incorrect 3 ms 464 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 114 ms 3660 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 179 ms 3932 KB Output isn't correct
2 Halted 0 ms 0 KB -