Submission #68392

# Submission time Handle Problem Language Result Execution time Memory
68392 2018-08-17T04:34:30 Z nvmdava Crayfish scrivener (IOI12_scrivener) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
string s[1000001];
int now = 0, i = 0;
void Init() {}

void TypeLetter(char L) {
	s[i] = s[now] + L;
	i++;
}

void UndoCommands(int U) {
	now -= U;
	s[i] = s[now];
	i++;
}

char GetLetter(int P) {
  return s[now][P];
}

Compilation message

scrivener.cpp:2:1: error: 'string' does not name a type; did you mean 'stdin'?
 string s[1000001];
 ^~~~~~
 stdin
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:7:2: error: 's' was not declared in this scope
  s[i] = s[now] + L;
  ^
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:13:2: error: 's' was not declared in this scope
  s[i] = s[now];
  ^
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:18:10: error: 's' was not declared in this scope
   return s[now][P];
          ^