Submission #1191569

#TimeUsernameProblemLanguageResultExecution timeMemory
1191569LolkasMeepCrayfish scrivener (IOI12_scrivener)C++20
Compilation error
0 ms0 KiB
#include "bits/stdc++.h"
using namespace std;
string h[1000005];
int i=1;
void Init(){h[0]="";}
void TypeLetter(char L){
    h[i]=h[i-1]+L;
    i++;
}
void UndoCommands(int U){
    h[i] = h[i-U];
    i++;
}
char GetLetter(int P){
    return h[i][p];
}

Compilation message (stderr)

scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:15:17: error: 'p' was not declared in this scope
   15 |     return h[i][p];
      |                 ^