제출 #68392

#제출 시각아이디문제언어결과실행 시간메모리
68392nvmdava크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
컴파일 에러
0 ms0 KiB
#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];
}

컴파일 시 표준 에러 (stderr) 메시지

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];
          ^