제출 #398274

#제출 시각아이디문제언어결과실행 시간메모리
398274chirathnirodha크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
컴파일 에러
0 ms0 KiB
//Coded by Chirath Nirodha
#include<bits/stdc++.h>
using namespace std;
string temp(1000000,' ');
vector<int> seq(1000001,0);
vector<string> s(1000001,temp)
int ss,seqs;
void Init(){
  string x;
  seq[0]=0;
  s[0]=x;
  seqs=ss=1;
}
void TypeLetter(char L) {
  string x=s[seq[seqs-1]];
  x.push_back(L);
  seq[seqs]=ss;seqs++;
  s[ss]=x;ss++;
}
void UndoCommands(int U) {
  seq[seqs]=seq[seqs-1-U];seqs++;
}
char GetLetter(int P) {
  return s[seq[seqs-1]][P];
}

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

scrivener.cpp:7:1: error: expected ',' or ';' before 'int'
    7 | int ss,seqs;
      | ^~~
scrivener.cpp: In function 'void Init()':
scrivener.cpp:12:3: error: 'seqs' was not declared in this scope; did you mean 'seq'?
   12 |   seqs=ss=1;
      |   ^~~~
      |   seq
scrivener.cpp:12:8: error: 'ss' was not declared in this scope; did you mean 's'?
   12 |   seqs=ss=1;
      |        ^~
      |        s
scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:15:18: error: 'seqs' was not declared in this scope; did you mean 'seq'?
   15 |   string x=s[seq[seqs-1]];
      |                  ^~~~
      |                  seq
scrivener.cpp:17:13: error: 'ss' was not declared in this scope; did you mean 's'?
   17 |   seq[seqs]=ss;seqs++;
      |             ^~
      |             s
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:21:7: error: 'seqs' was not declared in this scope; did you mean 'seq'?
   21 |   seq[seqs]=seq[seqs-1-U];seqs++;
      |       ^~~~
      |       seq
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:24:16: error: 'seqs' was not declared in this scope; did you mean 'seq'?
   24 |   return s[seq[seqs-1]][P];
      |                ^~~~
      |                seq