Submission #456164

#TimeUsernameProblemLanguageResultExecution timeMemory
456164BT21tataCrayfish scrivener (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std; 

string s[1000005];
int pos=0;

void Init() {}

void TypeLetter(char L)
{
    s[pos+1]=s[pos]+L;
    pos++;
}

void UndoCommands(int U)
{
    s[pos+1]=s[pos-U]
    pos++;
}

char GetLetter(int P)
{
    return s[pos][P];
}
/*
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
*/

Compilation message (stderr)

scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:17:22: error: expected ';' before 'pos'
   17 |     s[pos+1]=s[pos-U]
      |                      ^
      |                      ;
   18 |     pos++;
      |     ~~~