Task: | Merkkijono |
Sender: | SeveriK |
Submission time: | 2017-10-03 18:24:34 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.05 s | details |
#2 | ACCEPTED | 0.04 s | details |
#3 | WRONG ANSWER | 0.05 s | details |
#4 | WRONG ANSWER | 0.05 s | details |
#5 | WRONG ANSWER | 0.05 s | details |
#6 | WRONG ANSWER | 0.06 s | details |
#7 | WRONG ANSWER | 0.05 s | details |
#8 | WRONG ANSWER | 0.04 s | details |
#9 | WRONG ANSWER | 0.04 s | details |
#10 | WRONG ANSWER | 0.04 s | details |
Code
/* #include <iostream> #include <string> using namespace std; int main() { for (int i = 0; i < 10; i++) { string curRow = ""; for (int o = 0; o < 10; o++) { int n = i + o; if (n > 9) { n -= 10; } curRow += to_string(n); n = o - i; if (n < 0) { n += 10; } if (n == 0) { curRow += "A "; } else if (n == 1) { curRow += "B "; } else if (n == 2) { curRow += "C "; } else if (n == 3) { curRow += "D "; } else if (n == 4) { curRow += "E "; } else if (n == 5) { curRow += "F "; } else if (n == 6) { curRow += "G "; } else if (n == 7) { curRow += "H "; } else if (n == 8) { curRow += "I "; } else if (n == 9) { curRow += "J "; } } cout << curRow << "\n"; } int a; cin >> a; return 0; }*/ //Tehtävä 5 #include <iostream> #include <string> using namespace std; int main() { string input = ""; cin >> input; bool modifyDone = false, modified = false, deleteNext = false; string output = ""; char lastChar = ' '; while (!modifyDone) { lastChar = ' '; output = ""; deleteNext = false; modified = false; for (unsigned int i = 0; i < input.length(); i++) { if (i != 0) { if (input[i] == lastChar && !modified) { output.pop_back(); deleteNext = true; modified = true; } else if(!deleteNext) { deleteNext = false; output += input[i]; lastChar = input[i]; } } else { lastChar = input[i]; output += input[i]; } } if (!modified || output.length() <= 0) { modifyDone = true; } else { input = output; cout << output << "\n"; } } cout << output << "\n"; int a; cin >> a; return 0; } //Tehtävä 1
Test details
Test 1
Verdict: ACCEPTED
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
ABABABABABABABABABABABABABABAB... |
user output |
---|
ABABABABABABABABABABABABABABAB... |
Test 2
Verdict: ACCEPTED
input |
---|
AABBAABBAABBAABBAABBAABBAABBAA... |
correct output |
---|
(empty) |
user output |
---|
(empty) |
Test 3
Verdict: WRONG ANSWER
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
(empty) |
user output |
---|
ABABABABABABABABABABABABABABAB... |
Test 4
Verdict: WRONG ANSWER
input |
---|
BBABABBBBBAABBBABABABBBBAAABAB... |
correct output |
---|
BAB |
user output |
---|
(empty) |
Test 5
Verdict: WRONG ANSWER
input |
---|
ACDCBBACDBBBACAACBBDBADBAABABA... |
correct output |
---|
ACDCACDADBADABACACDCADADABABCA... |
user output |
---|
ACDC ACDC |
Test 6
Verdict: WRONG ANSWER
input |
---|
EETFHIJOGACDHMGVFJCMETMZDEITTR... |
correct output |
---|
TFHIJOGACDHMGVFJCMETMZDEIROTET... |
user output |
---|
(empty) |
Test 7
Verdict: WRONG ANSWER
input |
---|
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB... |
correct output |
---|
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE... |
user output |
---|
G G |
Test 8
Verdict: WRONG ANSWER
input |
---|
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS... |
correct output |
---|
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK... |
user output |
---|
PISHWMOTC PISHWMOTC |
Test 9
Verdict: WRONG ANSWER
input |
---|
QUVVTPXAMWWODFXRONJODPGBTCISGM... |
correct output |
---|
QUTPXAMODFXRONJODPGBTCISGMVRBW... |
user output |
---|
QU QU |
Test 10
Verdict: WRONG ANSWER
input |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
correct output |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
user output |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |