QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#90038 | #5483. Class Field Trip | ChatGPT | AC ✓ | 3ms | 3468kb | C++23 | 759b | 2023-03-22 02:50:52 | 2023-03-22 02:50:55 |
Judging History
answer
#include <iostream>
#include <string>
using namespace std;
int main() {
// read in Ann's and Ben's lists
string ann, ben;
cin >> ann >> ben;
// initialize variables for the merged list
string merged = "";
int i = 0, j = 0;
// merge Ann's and Ben's lists
while (i < ann.length() && j < ben.length()) {
if (ann[i] < ben[j]) {
merged += ann[i];
i++;
} else {
merged += ben[j];
j++;
}
}
while (i < ann.length()) {
merged += ann[i];
i++;
}
while (j < ben.length()) {
merged += ben[j];
j++;
}
// output the merged list
cout << merged << endl;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3408kb
input:
ahjmnoy acijjkll
output:
aachijjjkllmnoy
result:
ok single line: 'aachijjjkllmnoy'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3460kb
input:
a a
output:
aa
result:
ok single line: 'aa'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3324kb
input:
aaaabbccddeeeefghijjknnnoopqrssssstttuuvwwxxxyyyyy abbcefgghiiiiiijjjllllmmnnooqqrssttuvvwxxxxxyyzzzz
output:
aaaaabbbbcccddeeeeeffggghhiiiiiiijjjjjkllllmmnnnnnoooopqqqrrssssssstttttuuuvvvwwwxxxxxxxxyyyyyyyzzzz
result:
ok single line: 'aaaaabbbbcccddeeeeeffggghhiiii...tttuuuvvvwwwxxxxxxxxyyyyyyyzzzz'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
aaaaabcdegghhhijlllmmnnnooppppqqrrrrssttuvwwwxyyzz aabbbbccgggggijjjjlllmmmnnooppqrtttuuuvvvwxxxxxyzz
output:
aaaaaaabbbbbcccdeggggggghhhiijjjjjllllllmmmmmnnnnnooooppppppqqqrrrrrsstttttuuuuvvvvwwwwxxxxxxyyyzzzz
result:
ok single line: 'aaaaaaabbbbbcccdeggggggghhhiij...stttttuuuuvvvvwwwwxxxxxxyyyzzzz'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3468kb
input:
aaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz a
output:
aaaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz
result:
ok single line: 'aaaaaabbbbcdeeeffggggghhhhiiii...sssttttuuuvvvwwwwwwwwwxyyyyzzzz'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3316kb
input:
aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzz z
output:
aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzzz
result:
ok single line: 'aaaaaabbbbbbccccddeeeefggggggh...ttuuuuuvvvvwwwxxxxxxxxyyyyyyzzz'
Test #7:
score: 0
Accepted
time: 2ms
memory: 3324kb
input:
z aaaaaabbbccdeefgggghhhhiiiiiiijjjjlllllllmmmmnnnnnooooppppqqqqrrrrrssssttttuuvvvwwwwxxxxxxyyyyzzzzzz
output:
aaaaaabbbccdeefgggghhhhiiiiiiijjjjlllllllmmmmnnnnnooooppppqqqqrrrrrssssttttuuvvvwwwwxxxxxxyyyyzzzzzzz
result:
ok single line: 'aaaaaabbbccdeefgggghhhhiiiiiii...sttttuuvvvwwwwxxxxxxyyyyzzzzzzz'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3336kb
input:
aaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzz
output:
aaaaaaaaaaabbbbbbbbbbcccccdddeeeeeeefffggggggggggghhhhhiiiiiijjjjjjjjjjkkkllllllllmmmmmnnnnnnnnnnnooooooooopppppppppqqqqqqqrrrrrrrssssssssttttttttttuuuuuuuuvvvvvvvwwwwwwwwwwwwxxxxxxxxxyyyyyyyyyyzzzzzz
result:
ok single line: 'aaaaaaaaaaabbbbbbbbbbcccccddde...wwwwwwxxxxxxxxxyyyyyyyyyyzzzzzz'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3464kb
input:
aaaaaabbbccdeefgggghhhhiiiiiiijjjjlllllllmmmmnnnnnooooppppqqqqrrrrrssssttttuuvvvwwwwxxxxxxyyyyzzzzzz aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzz
output:
aaaaaaaaaaaabbbbbbbbbccccccdddeeeeeeffgggggggggghhhhhiiiiiiiiijjjjjjjjjjkllllllllllmmmmmmmnnnnnnnnnnoooooooopppppppqqqqqqrrrrrrrsssssssssttttttttttuuuuuuuvvvvvvvwwwwwwwxxxxxxxxxxxxxxyyyyyyyyyyzzzzzzzz
result:
ok single line: 'aaaaaaaaaaaabbbbbbbbbccccccddd...xxxxxxxxxxxxxyyyyyyyyyyzzzzzzzz'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3316kb
input:
aaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz aaabceehiillmnorrtv
output:
aaaaaaaabbbbbccdeeeeeffggggghhhhhiiiiiijjjjkklllllllmmmnnnnnnnooooooppppppqqqqqrrrrrrrssstttttuuuvvvvwwwwwwwwwxyyyyzzzz
result:
ok single line: 'aaaaaaaabbbbbccdeeeeeffggggghh...stttttuuuvvvvwwwwwwwwwxyyyyzzzz'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3312kb
input:
z a
output:
az
result:
ok single line: 'az'
Test #12:
score: 0
Accepted
time: 3ms
memory: 3464kb
input:
a z
output:
az
result:
ok single line: 'az'
Test #13:
score: 0
Accepted
time: 2ms
memory: 3312kb
input:
aabeehiklmmsy aaabceehiillmnorrtv
output:
aaaaabbceeeehhiiiklllmmmnorrstvy
result:
ok single line: 'aaaaabbceeeehhiiiklllmmmnorrstvy'
Test #14:
score: 0
Accepted
time: 2ms
memory: 3320kb
input:
ahijjmmnory aabeehiklmmsy
output:
aaabeehhiijjklmmmmnorsyy
result:
ok single line: 'aaabeehhiijjklmmmmnorsyy'
Test #15:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
aaaaabcdegghhhijlllmmnnnooppppqqrrrrssttuvwwwxyyzz hjno
output:
aaaaabcdegghhhhijjlllmmnnnnoooppppqqrrrrssttuvwwwxyyzz
result:
ok single line: 'aaaaabcdegghhhhijjlllmmnnnnoooppppqqrrrrssttuvwwwxyyzz'
Test #16:
score: 0
Accepted
time: 2ms
memory: 3368kb
input:
ahijjmmnory bbbeeffggghiiijjjkkllnnnoooppqqqrsttuuvvwwwwwwyyzz
output:
abbbeeffggghhiiiijjjjjkkllmmnnnnooooppqqqrrsttuuvvwwwwwwyyyzz
result:
ok single line: 'abbbeeffggghhiiiijjjjjkkllmmnnnnooooppqqqrrsttuuvvwwwwwwyyyzz'
Test #17:
score: 0
Accepted
time: 2ms
memory: 3404kb
input:
aabbbbccgggggijjjjlllmmmnnooppqrtttuuuvvvwxxxxxyzz aabeehiklmmsy
output:
aaaabbbbbcceeggggghiijjjjkllllmmmmmnnooppqrstttuuuvvvwxxxxxyyzz
result:
ok single line: 'aaaabbbbbcceeggggghiijjjjkllllmmmmmnnooppqrstttuuuvvvwxxxxxyyzz'
Test #18:
score: 0
Accepted
time: 2ms
memory: 3320kb
input:
aaabceehiillmnorrtv aaaabbccddeeeefghijjknnnoopqrssssstttuuvwwxxxyyyyy
output:
aaaaaaabbbcccddeeeeeefghhiiijjkllmnnnnooopqrrrsssssttttuuvvwwxxxyyyyy
result:
ok single line: 'aaaaaaabbbcccddeeeeeefghhiiijj...ooopqrrrsssssttttuuvvwwxxxyyyyy'