QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#240013#5483. Class Field Tripkareemsakkary#AC ✓0ms3784kbC++14480b2023-11-05 07:18:342023-11-05 07:18:35

Judging History

你现在查看的是最新测评结果

  • [2023-11-05 07:18:35]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3784kb
  • [2023-11-05 07:18:34]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

int main(){
    string x , y; cin >> x >> y;
    int i = 0 , j = 0;
    string ans ;
    sort(x.begin(), x.end());
    sort(y.begin(), y.end());
    while (i < x.size() && j < y.size()){
        if(x[i] < y[j]){
            ans += x[i];
            i++;
        }else{
            ans += y[j++];
        }
    }
    while(i < x.size()) ans+=x[i++];
    while(j < y.size()) ans+=y[j++];
    cout << ans << endl;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3504kb

input:

ahjmnoy
acijjkll

output:

aachijjjkllmnoy

result:

ok single line: 'aachijjjkllmnoy'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

a
a

output:

aa

result:

ok single line: 'aa'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

aaaabbccddeeeefghijjknnnoopqrssssstttuuvwwxxxyyyyy
abbcefgghiiiiiijjjllllmmnnooqqrssttuvvwxxxxxyyzzzz

output:

aaaaabbbbcccddeeeeeffggghhiiiiiiijjjjjkllllmmnnnnnoooopqqqrrssssssstttttuuuvvvwwwxxxxxxxxyyyyyyyzzzz

result:

ok single line: 'aaaaabbbbcccddeeeeeffggghhiiii...tttuuuvvvwwwxxxxxxxxyyyyyyyzzzz'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

aaaaabcdegghhhijlllmmnnnooppppqqrrrrssttuvwwwxyyzz
aabbbbccgggggijjjjlllmmmnnooppqrtttuuuvvvwxxxxxyzz

output:

aaaaaaabbbbbcccdeggggggghhhiijjjjjllllllmmmmmnnnnnooooppppppqqqrrrrrsstttttuuuuvvvvwwwwxxxxxxyyyzzzz

result:

ok single line: 'aaaaaaabbbbbcccdeggggggghhhiij...stttttuuuuvvvvwwwwxxxxxxyyyzzzz'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3492kb

input:

aaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz
a

output:

aaaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz

result:

ok single line: 'aaaaaabbbbcdeeeffggggghhhhiiii...sssttttuuuvvvwwwwwwwwwxyyyyzzzz'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzz
z

output:

aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzzz

result:

ok single line: 'aaaaaabbbbbbccccddeeeefggggggh...ttuuuuuvvvvwwwxxxxxxxxyyyyyyzzz'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3404kb

input:

z
aaaaaabbbccdeefgggghhhhiiiiiiijjjjlllllllmmmmnnnnnooooppppqqqqrrrrrssssttttuuvvvwwwwxxxxxxyyyyzzzzzz

output:

aaaaaabbbccdeefgggghhhhiiiiiiijjjjlllllllmmmmnnnnnooooppppqqqqrrrrrssssttttuuvvvwwwwxxxxxxyyyyzzzzzzz

result:

ok single line: 'aaaaaabbbccdeefgggghhhhiiiiiii...sttttuuvvvwwwwxxxxxxyyyyzzzzzzz'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

aaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz
aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzz

output:

aaaaaaaaaaabbbbbbbbbbcccccdddeeeeeeefffggggggggggghhhhhiiiiiijjjjjjjjjjkkkllllllllmmmmmnnnnnnnnnnnooooooooopppppppppqqqqqqqrrrrrrrssssssssttttttttttuuuuuuuuvvvvvvvwwwwwwwwwwwwxxxxxxxxxyyyyyyyyyyzzzzzz

result:

ok single line: 'aaaaaaaaaaabbbbbbbbbbcccccddde...wwwwwwxxxxxxxxxyyyyyyyyyyzzzzzz'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

aaaaaabbbccdeefgggghhhhiiiiiiijjjjlllllllmmmmnnnnnooooppppqqqqrrrrrssssttttuuvvvwwwwxxxxxxyyyyzzzzzz
aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzz

output:

aaaaaaaaaaaabbbbbbbbbccccccdddeeeeeeffgggggggggghhhhhiiiiiiiiijjjjjjjjjjkllllllllllmmmmmmmnnnnnnnnnnoooooooopppppppqqqqqqrrrrrrrsssssssssttttttttttuuuuuuuvvvvvvvwwwwwwwxxxxxxxxxxxxxxyyyyyyyyyyzzzzzzzz

result:

ok single line: 'aaaaaaaaaaaabbbbbbbbbccccccddd...xxxxxxxxxxxxxyyyyyyyyyyzzzzzzzz'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3720kb

input:

aaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz
aaabceehiillmnorrtv

output:

aaaaaaaabbbbbccdeeeeeffggggghhhhhiiiiiijjjjkklllllllmmmnnnnnnnooooooppppppqqqqqrrrrrrrssstttttuuuvvvvwwwwwwwwwxyyyyzzzz

result:

ok single line: 'aaaaaaaabbbbbccdeeeeeffggggghh...stttttuuuvvvvwwwwwwwwwxyyyyzzzz'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

z
a

output:

az

result:

ok single line: 'az'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

a
z

output:

az

result:

ok single line: 'az'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

aabeehiklmmsy
aaabceehiillmnorrtv

output:

aaaaabbceeeehhiiiklllmmmnorrstvy

result:

ok single line: 'aaaaabbceeeehhiiiklllmmmnorrstvy'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

ahijjmmnory
aabeehiklmmsy

output:

aaabeehhiijjklmmmmnorsyy

result:

ok single line: 'aaabeehhiijjklmmmmnorsyy'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

aaaaabcdegghhhijlllmmnnnooppppqqrrrrssttuvwwwxyyzz
hjno

output:

aaaaabcdegghhhhijjlllmmnnnnoooppppqqrrrrssttuvwwwxyyzz

result:

ok single line: 'aaaaabcdegghhhhijjlllmmnnnnoooppppqqrrrrssttuvwwwxyyzz'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3460kb

input:

ahijjmmnory
bbbeeffggghiiijjjkkllnnnoooppqqqrsttuuvvwwwwwwyyzz

output:

abbbeeffggghhiiiijjjjjkkllmmnnnnooooppqqqrrsttuuvvwwwwwwyyyzz

result:

ok single line: 'abbbeeffggghhiiiijjjjjkkllmmnnnnooooppqqqrrsttuuvvwwwwwwyyyzz'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

aabbbbccgggggijjjjlllmmmnnooppqrtttuuuvvvwxxxxxyzz
aabeehiklmmsy

output:

aaaabbbbbcceeggggghiijjjjkllllmmmmmnnooppqrstttuuuvvvwxxxxxyyzz

result:

ok single line: 'aaaabbbbbcceeggggghiijjjjkllllmmmmmnnooppqrstttuuuvvvwxxxxxyyzz'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

aaabceehiillmnorrtv
aaaabbccddeeeefghijjknnnoopqrssssstttuuvwwxxxyyyyy

output:

aaaaaaabbbcccddeeeeeefghhiiijjkllmnnnnooopqrrrsssssttttuuvvwwxxxyyyyy

result:

ok single line: 'aaaaaaabbbcccddeeeeeefghhiiijj...ooopqrrrsssssttttuuvvwwxxxyyyyy'