Task: | Pakkaus |
Sender: | 3isagreatnumber |
Submission time: | 2016-10-05 12:21:13 +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.14 s | 1 | details |
#2 | RUNTIME ERROR | 0.15 s | 1 | details |
#3 | ACCEPTED | 0.06 s | 1 | details |
#4 | RUNTIME ERROR | 0.12 s | 1 | details |
#5 | RUNTIME ERROR | 0.15 s | 1 | details |
#6 | RUNTIME ERROR | 0.14 s | 2 | details |
#7 | RUNTIME ERROR | 0.14 s | 2 | details |
#8 | ACCEPTED | 0.05 s | 2 | details |
#9 | ACCEPTED | 0.06 s | 2 | details |
#10 | ACCEPTED | 0.06 s | 2 | details |
#11 | RUNTIME ERROR | 0.18 s | 3 | details |
#12 | RUNTIME ERROR | 0.25 s | 3 | details |
#13 | ACCEPTED | 0.09 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:64:5: warning: 's_h' may be used uninitialized in this function [-Wmaybe-uninitialized] for (ull j = s_l; j <= s_h; j++) ^ input/code.cpp:34:13: warning: 'n_h' may be used uninitialized in this function [-Wmaybe-uninitialized] for (ull j = n_l; j <= n_h; j++) ^
Code
#include <iostream> #include <string> #include <vector> #include <ctype.h> #include <stdlib.h> #define ull unsigned long long using namespace std; int main(void) { string s; cin >> s; vector<ull> n; vector<string> str; ull n_l = 0; ull n_h; ull s_l; ull s_h; for (ull 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 (ull 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 (ull j = s_l; j <= s_h; j++) { tmp+=s[j]; } str.push_back(tmp); } } string tmp; for (ull j = s_l; j <= s_h; j++) { tmp+=s[j]; } str.push_back(tmp); for (ull i = 0; i < n.size(); i++) { for (ull 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 |