Submission #398238

#TimeUsernameProblemLanguageResultExecution timeMemory
398238chirathnirodhaCrayfish scrivener (IOI12_scrivener)C++17
Compilation error
0 ms0 KiB
//Coded by Chirath Nirodha #include<bits/stdc++.h> using namespace std; int seq[1000010]; string s[1000010]; 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]=s.size();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]; }

Compilation message (stderr)

scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:16:15: error: request for member 'size' in 's', which is of non-class type 'std::string [1000010]' {aka 'std::__cxx11::basic_string<char> [1000010]'}
   16 |   seq[seqs]=s.size();seqs++;
      |               ^~~~