Task: | Merkkijono |
Sender: | koneistitLiikaa |
Submission time: | 2017-10-15 12:13:45 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.05 s | details |
#2 | WRONG ANSWER | 0.05 s | details |
#3 | WRONG ANSWER | 0.04 s | details |
#4 | WRONG ANSWER | 0.06 s | details |
#5 | WRONG ANSWER | 0.06 s | details |
#6 | WRONG ANSWER | 0.06 s | details |
#7 | WRONG ANSWER | 0.07 s | details |
#8 | WRONG ANSWER | 0.07 s | details |
#9 | WRONG ANSWER | 0.07 s | details |
#10 | WRONG ANSWER | 0.07 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:8:17: warning: narrowing conversion of 's.std::basic_string<_CharT, _Traits, _Alloc>::length<char, std::char_traits<char>, std::allocator<char> >()' from 'std::basic_string<char>::size_type {aka long unsigned int}' to 'int' inside { } [-Wnarrowing] int l{s.length()}; ^ input/code.cpp:12:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j{0}; f && j < s.length(); j++) { ^
Code
#include <iostream> using namespace std; int main() { string s; cin >> s; int l{s.length()}; bool f{1}; int i{0}; while(i < l) { for(int j{0}; f && j < s.length(); j++) { int k{1}; for (; s[j+k] == s[j]; k++) { f = 0; } if (k > 1) s = s.substr(0,j) + s.substr(j+k); } f = 1; i++; } cout << "s: " << s; return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
ABABABABABABABABABABABABABABAB... |
user output |
---|
s: ABABABABABABABABABABABABABA... |
Test 2
Verdict: WRONG ANSWER
input |
---|
AABBAABBAABBAABBAABBAABBAABBAA... |
correct output |
---|
(empty) |
user output |
---|
s: |
Test 3
Verdict: WRONG ANSWER
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
(empty) |
user output |
---|
s: |
Test 4
Verdict: WRONG ANSWER
input |
---|
BBABABBBBBAABBBABABABBBBAAABAB... |
correct output |
---|
BAB |
user output |
---|
s: BAB |
Test 5
Verdict: WRONG ANSWER
input |
---|
ACDCBBACDBBBACAACBBDBADBAABABA... |
correct output |
---|
ACDCACDADBADABACACDCADADABABCA... |
user output |
---|
s: ACDCACDADBADABACACDCADADABA... |
Test 6
Verdict: WRONG ANSWER
input |
---|
EETFHIJOGACDHMGVFJCMETMZDEITTR... |
correct output |
---|
TFHIJOGACDHMGVFJCMETMZDEIROTET... |
user output |
---|
s: TFHIJOGACDHMGVFJCMETMZDEIRO... |
Test 7
Verdict: WRONG ANSWER
input |
---|
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB... |
correct output |
---|
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE... |
user output |
---|
s: GNLAHLYPRFCZKIKSJWAYPCDNWYM... |
Test 8
Verdict: WRONG ANSWER
input |
---|
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS... |
correct output |
---|
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK... |
user output |
---|
s: PISHWMOTCZFRMYMOMYDGJZIQHSV... |
Test 9
Verdict: WRONG ANSWER
input |
---|
QUVVTPXAMWWODFXRONJODPGBTCISGM... |
correct output |
---|
QUTPXAMODFXRONJODPGBTCISGMVRBW... |
user output |
---|
s: QUTPXAMODFXRONJODPGBTCISGMV... |
Test 10
Verdict: WRONG ANSWER
input |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
correct output |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
user output |
---|
s: POXHAHYEZTLYNFSLABODMRNKDSK... |