Task: | Monistus |
Sender: | perusjuntti |
Submission time: | 2023-11-02 22:28:11 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#2 | ACCEPTED | 0.00 s | 1, 2 | details |
#3 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#4 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#5 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#6 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#7 | WRONG ANSWER | 0.00 s | 1, 2 | details |
#8 | WRONG ANSWER | 0.01 s | 2 | details |
#9 | WRONG ANSWER | 0.03 s | 2 | details |
#10 | WRONG ANSWER | 0.03 s | 2 | details |
#11 | ACCEPTED | 0.04 s | 2 | details |
#12 | WRONG ANSWER | 0.04 s | 2 | details |
#13 | WRONG ANSWER | 0.04 s | 2 | details |
#14 | WRONG ANSWER | 0.03 s | 2 | details |
Code
#include <bits/stdc++.h> using namespace std; queue<char> q; int main() { string s; cin >> s; int n = s.size(); for (int i = 0; i < n; ++i) { if (!isdigit(s[i])) q.push(s[i]); else { string mul = ""; int d = s[i]-'0'; for (int j = i+1; j <= i+d; ++j) { if (!isdigit(s[j])) mul += s[j]; else { int d2 = s[j]-'0'; for (int k = 0; k < d2; ++k) mul += mul[k]; } } for (char c : mul) q.push(c); } } while (q.size()) { cout << q.front(); q.pop(); } }