Task: | Pakkaus |
Sender: | 3isagreatnumber |
Submission time: | 2016-10-05 12:15:43 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
#2 | RUNTIME ERROR | 0 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | RUNTIME ERROR | 0.13 s | 1 | details |
#2 | RUNTIME ERROR | 0.15 s | 1 | details |
#3 | ACCEPTED | 0.05 s | 1 | details |
#4 | RUNTIME ERROR | 0.15 s | 1 | details |
#5 | RUNTIME ERROR | 0.13 s | 1 | details |
#6 | RUNTIME ERROR | 0.14 s | 2 | details |
#7 | RUNTIME ERROR | 0.15 s | 2 | details |
#8 | ACCEPTED | 0.06 s | 2 | details |
#9 | ACCEPTED | 0.05 s | 2 | details |
#10 | ACCEPTED | 0.05 s | 2 | details |
#11 | RUNTIME ERROR | 0.19 s | 3 | details |
#12 | RUNTIME ERROR | 0.22 s | 3 | details |
#13 | ACCEPTED | 0.08 s | 3 | details |
#14 | ACCEPTED | 0.05 s | 3 | details |
#15 | ACCEPTED | 0.05 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:22:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 1; i < s.length(); i++) ^ input/code.cpp:69:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < n.size(); i++) ^ input/code.cpp:63:5: warning: 's_h' may be used uninitialized in this function [-Wmaybe-uninitialized] for (int j = s_l; j <= s_h; j++) ^ input/code.cpp:19:9: warning: 's_l' may be used uninitialized in this function [-Wmaybe-uninitialized] int s_l; ^ input/code.cpp:33:13: warning: 'n_h' may be used uninitialized in this function [-Wmaybe-uninitialized] for (int j = n_l; j <= n_h; j++) ^
Code
#include <iostream> #include <string> #include <vector> #include <ctype.h> #include <stdlib.h> using namespace std; int main(void) { string s; cin >> s; vector<int> n; vector<string> str; int n_l = 0; int n_h; int s_l; int s_h; for (int i = 1; i < s.length(); i++) { // move n upper bound if (isdigit(s[i]) && isdigit(s[i-1])) { n_h = i; } else if (!isdigit(s[i]) && isdigit(s[i-1])) { // save number string tmp; for (int j = n_l; j <= n_h; j++) { tmp+=s[j]; } n.push_back(atoi(tmp.c_str())); // store s lower bound s_l = i; s_h = i; } else if (!isdigit(s[i]) && !isdigit(s[i-1])) { s_h = i; } else if (!isdigit(s[i-1]) && isdigit(s[i])) { n_l = i; n_h = i; // save string string tmp; for (int j = s_l; j <= s_h; j++) { tmp+=s[j]; } str.push_back(tmp); } } string tmp; for (int j = s_l; j <= s_h; j++) { tmp+=s[j]; } str.push_back(tmp); for (int i = 0; i < n.size(); i++) { for (int j = 0; j < n[i]; j++) { cout << str[i]; } } cout << endl; }
Test details
Test 1
Group: 1
Verdict: RUNTIME ERROR
input |
---|
1AAAAAAAAAAAAAAAAAAAA |
correct output |
---|
AAAAAAAAAAAAAAAAAAAA |
user output |
---|
(empty) |
Test 2
Group: 1
Verdict: RUNTIME ERROR
input |
---|
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAA |
user output |
---|
(empty) |
Test 3
Group: 1
Verdict: ACCEPTED
input |
---|
20A |
correct output |
---|
AAAAAAAAAAAAAAAAAAAA |
user output |
---|
AAAAAAAAAAAAAAAAAAAA |
Test 4
Group: 1
Verdict: RUNTIME ERROR
input |
---|
2N1J2F1XH2D2B2VT1N1ES |
correct output |
---|
NNJFFXHDDBBVTVTNES |
user output |
---|
(empty) |
Test 5
Group: 1
Verdict: RUNTIME ERROR
input |
---|
2Z1E1UN1P2A2A1D2F2EZ1FZ1J |
correct output |
---|
ZZEUNPAAAADFFEZEZFZJ |
user output |
---|
(empty) |
Test 6
Group: 2
Verdict: RUNTIME ERROR
input |
---|
1AAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 7
Group: 2
Verdict: RUNTIME ERROR
input |
---|
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 8
Group: 2
Verdict: ACCEPTED
input |
---|
1000A |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... Truncated |
Test 9
Group: 2
Verdict: ACCEPTED
input |
---|
11QOUDQFAFUPAYCPXZ15KANCLRGT9S... |
correct output |
---|
QOUDQFAFUPAYCPXZQOUDQFAFUPAYCP... |
user output |
---|
QOUDQFAFUPAYCPXZQOUDQFAFUPAYCP... Truncated |
Test 10
Group: 2
Verdict: ACCEPTED
input |
---|
20NFBIUXOSO10XRXZRMULZDUFK14BB... |
correct output |
---|
NFBIUXOSONFBIUXOSONFBIUXOSONFB... |
user output |
---|
NFBIUXOSONFBIUXOSONFBIUXOSONFB... Truncated |
Test 11
Group: 3
Verdict: RUNTIME ERROR
input |
---|
1AAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 12
Group: 3
Verdict: RUNTIME ERROR
input |
---|
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 13
Group: 3
Verdict: ACCEPTED
input |
---|
1000000A |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... Truncated |
Test 14
Group: 3
Verdict: ACCEPTED
input |
---|
87GEIGDBZCYGSFYYCGQUAWQJFUUAQG... |
correct output |
---|
GEIGDBZCYGSFYYCGQUAWQJFUUAQGDT... |
user output |
---|
GEIGDBZCYGSFYYCGQUAWQJFUUAQGDT... Truncated |
Test 15
Group: 3
Verdict: ACCEPTED
input |
---|
316XXYCLTBFQRAXHQPTLDB275NMQJD... |
correct output |
---|
XXYCLTBFQRAXHQPTLDBXXYCLTBFQRA... |
user output |
---|
XXYCLTBFQRAXHQPTLDBXXYCLTBFQRA... Truncated |