Task: | Monistus |
Sender: | drvilepis |
Submission time: | 2023-10-30 13:49:08 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#2 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#3 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#4 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#5 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#6 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#7 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#8 | WRONG ANSWER | 0.18 s | 2 | details |
#9 | TIME LIMIT EXCEEDED | -- | 2 | details |
#10 | TIME LIMIT EXCEEDED | -- | 2 | details |
#11 | TIME LIMIT EXCEEDED | -- | 2 | details |
#12 | TIME LIMIT EXCEEDED | -- | 2 | details |
#13 | TIME LIMIT EXCEEDED | -- | 2 | details |
#14 | TIME LIMIT EXCEEDED | -- | 2 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:15:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 15 | while (i < input.length()) { | ~~^~~~~~~~~~~~~~~~
Code
#include <iostream> #include <string> #include <type_traits> int main() { std::string input; input.resize(500000); std::cin >> input; int i = 0; std::string store; store.resize(500000); while (i < input.length()) { char c = input[i]; if (c >= '1' && c <= '9') { std::cout << input.substr(0, i); int n = c - 48; store.append(input.substr(i+1, n)); store.append(input.substr(i+1, input.size()-i+1)); std::swap(store, input); store.clear(); i = 0; } else { ++i; } } std::cout << input << "\n"; }