Task: | Merkkijono |
Sender: | ankka22 |
Submission time: | 2017-10-02 20:50:30 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.04 s | details |
#2 | RUNTIME ERROR | 0.20 s | details |
#3 | ACCEPTED | 0.05 s | details |
#4 | WRONG ANSWER | 0.05 s | details |
#5 | WRONG ANSWER | 0.04 s | details |
#6 | ACCEPTED | 0.05 s | details |
#7 | ACCEPTED | 0.04 s | details |
#8 | ACCEPTED | 0.04 s | details |
#9 | WRONG ANSWER | 0.04 s | details |
#10 | ACCEPTED | 0.06 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:10:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 1; i < s.size(); i++) { ^ input/code.cpp:13:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int o = i; o < s.size(); o++) { ^
Code
#include <iostream> #include <string> using namespace std; string s; bool ok; int main() { cin >> s; while (1) { ok = true; for (int i = 1; i < s.size(); i++) { if (s.at(i) == s.at(i-1)) { ok = false; for (int o = i; o < s.size(); o++) { s.erase(s.begin() + i); if (s.size() == 1 || s.at(i) != s.at(i-1)) break; } s.erase(s.begin() + i-1); } } if (ok) break; } cout << s << endl; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
ABABABABABABABABABABABABABABAB... |
user output |
---|
ABABABABABABABABABABABABABABAB... |
Test 2
Verdict: RUNTIME ERROR
input |
---|
AABBAABBAABBAABBAABBAABBAABBAA... |
correct output |
---|
(empty) |
user output |
---|
(empty) |
Error:
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at
Test 3
Verdict: ACCEPTED
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
(empty) |
user output |
---|
(empty) |
Test 4
Verdict: WRONG ANSWER
input |
---|
BBABABBBBBAABBBABABABBBBAAABAB... |
correct output |
---|
BAB |
user output |
---|
AB |
Test 5
Verdict: WRONG ANSWER
input |
---|
ACDCBBACDBBBACAACBBDBADBAABABA... |
correct output |
---|
ACDCACDADBADABACACDCADADABABCA... |
user output |
---|
ACDCACDADBADABACACDCADADABABCA... |
Test 6
Verdict: ACCEPTED
input |
---|
EETFHIJOGACDHMGVFJCMETMZDEITTR... |
correct output |
---|
TFHIJOGACDHMGVFJCMETMZDEIROTET... |
user output |
---|
TFHIJOGACDHMGVFJCMETMZDEIROTET... |
Test 7
Verdict: ACCEPTED
input |
---|
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB... |
correct output |
---|
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE... |
user output |
---|
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE... |
Test 8
Verdict: ACCEPTED
input |
---|
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS... |
correct output |
---|
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK... |
user output |
---|
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK... |
Test 9
Verdict: WRONG ANSWER
input |
---|
QUVVTPXAMWWODFXRONJODPGBTCISGM... |
correct output |
---|
QUTPXAMODFXRONJODPGBTCISGMVRBW... |
user output |
---|
QUTPXAMODFXRONJODPGBTCISGMVRBW... |
Test 10
Verdict: ACCEPTED
input |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
correct output |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
user output |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |