CSES - Datatähti 2024 alku - Results
Submission details
Task:Monistus
Sender:vgtcross
Submission time:2023-11-03 11:45:35 +0200
Language:C++ (C++20)
Status:COMPILE ERROR

Compiler report

input/code.cpp:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include bitsstdc++.h
      |          ^~~~~~~~
input/code.cpp: In function 'int main()':
input/code.cpp:3:5: error: 'stdstring' was not declared in this scope
    3 |     stdstring s;
      |     ^~~~~~~~~
input/code.cpp:4:5: error: 'stdcin' was not declared in this scope
    4 |     stdcin  s;
      |     ^~~~~~
input/code.cpp:5:13: error: 's' was not declared in this scope
    5 |     reverse(s.begin(), s.end());
      |             ^
input/code.cpp:5:5: error: 'reverse' was not declared in this scope
    5 |     reverse(s.begin(), s.end());
      |     ^~~~~~~
input/code.cpp:9:21: error: lvalue required as left operand of assignment
    9 |         if (c = '1' && c = '9') s += s.substr(s.size()-c+'0', c-'0');
      |                 ~~~~^~~~
input/code.cpp:10:14: error: 'stdcout' was not declared in this scope
   10 |         else stdcout  c;
      |              ^~~~~~~

Code

#include bitsstdc++.h
int main() {
    stdstring s;
    stdcin  s;
    reverse(s.begin(), s.end());
    while (s.size()) {
        char c = s.back();
        s.pop_back();
        if (c = '1' && c = '9') s += s.substr(s.size()-c+'0', c-'0');
        else stdcout  c;
    }
}