Task: | Merkkijono |
Sender: | Challe |
Submission time: | 2017-10-09 22:18:42 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.04 s | details |
#2 | RUNTIME ERROR | 0.18 s | details |
#3 | WRONG ANSWER | 0.06 s | details |
#4 | WRONG ANSWER | 0.04 s | details |
#5 | RUNTIME ERROR | 0.20 s | details |
#6 | WRONG ANSWER | 0.06 s | details |
#7 | WRONG ANSWER | 0.05 s | details |
#8 | WRONG ANSWER | 0.05 s | details |
#9 | WRONG ANSWER | 0.05 s | details |
#10 | WRONG ANSWER | 0.06 s | details |
Compiler report
input/code.cpp: In function 'std::vector<std::basic_string<char> > Funktio(std::string)': input/code.cpp:16:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while (num < mjono.length()) { ^ input/code.cpp:19:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (num + 1 == mjono.length()) { ^ input/code.cpp: In function 'std::vector<std::basic_string<char> > Funktio2(std::vector<std::basic_string<char> >)': input/code.cpp:36:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while (num < jonot.size()) { ^ input/code.cpp: In function 'int main()': input/code.cpp:55:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int c = 0; c < jonot2.size(); c++) { ^
Code
// ConsoleApplication2.cpp : Defines the entry point for the console application. // #include <vector> #include <iostream> #include <string> using namespace std; vector<string> Funktio(string mjono) { vector<string> jonot; string kirjain; int num = 0; int num2 = 0; while (num < mjono.length()) { kirjain.push_back(mjono.at(num)); jonot.push_back(kirjain); if (num + 1 == mjono.length()) { break; } while (mjono.at(num) == mjono.at(num + 1)) { jonot[num2].push_back(mjono.at(num)); num++; } num2++; num++; kirjain.clear(); } return jonot; } vector<string> Funktio2(vector<string> jonot) { int num = 0; while (num < jonot.size()) { if (jonot[num].length() > 1) { jonot.erase(jonot.begin() + num); } else { num++; } } return jonot; } int main() { string mjono; cin >> mjono; vector<string> jonot; vector<string> jonot2; jonot = Funktio(mjono); jonot2 = Funktio2(jonot); for (int c = 0; c < jonot2.size(); c++) { cout << jonot2[c] << "\n"; } cin >> mjono; return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
ABABABABABABABABABABABABABABAB... |
user output |
---|
A B A B A ... |
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: WRONG ANSWER
input |
---|
ABABABABABABABABABABABABABABAB... |
correct output |
---|
(empty) |
user output |
---|
A B A B A ... |
Test 4
Verdict: WRONG ANSWER
input |
---|
BBABABBBBBAABBBABABABBBBAAABAB... |
correct output |
---|
BAB |
user output |
---|
A B A A B ... |
Test 5
Verdict: RUNTIME ERROR
input |
---|
ACDCBBACDBBBACAACBBDBADBAABABA... |
correct output |
---|
ACDCACDADBADABACACDCADADABABCA... |
user output |
---|
(empty) |
Error:
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at
Test 6
Verdict: WRONG ANSWER
input |
---|
EETFHIJOGACDHMGVFJCMETMZDEITTR... |
correct output |
---|
TFHIJOGACDHMGVFJCMETMZDEIROTET... |
user output |
---|
T F H I J ... |
Test 7
Verdict: WRONG ANSWER
input |
---|
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB... |
correct output |
---|
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE... |
user output |
---|
G N L A H ... |
Test 8
Verdict: WRONG ANSWER
input |
---|
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS... |
correct output |
---|
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK... |
user output |
---|
P I S H W ... |
Test 9
Verdict: WRONG ANSWER
input |
---|
QUVVTPXAMWWODFXRONJODPGBTCISGM... |
correct output |
---|
QUTPXAMODFXRONJODPGBTCISGMVRBW... |
user output |
---|
Q U T P X ... |
Test 10
Verdict: WRONG ANSWER
input |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
correct output |
---|
POXHAHYEZTLYNFSLABODMRNKDSKROZ... |
user output |
---|
P O X H A ... |