QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#188525#5483. Class Field Tripbeshoyhany#AC ✓0ms3832kbC++201.6kb2023-09-25 22:27:542023-09-25 22:27:54

Judging History

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

  • [2023-09-25 22:27:54]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3832kb
  • [2023-09-25 22:27:54]
  • 提交

answer

#include<bits/stdc++.h>

#define ll long long
#define pp push_back
#define endl '\n'
#define all(x) x.begin(),x.end()
#define ld long double
#define PI acos(-1)
#define sin(a) sin((a)*PI/180)
#define cos(a) cos((a)*PI/180)
#define ones(x) __builtin_popcountll(x)
//#define int ll

using namespace std;

void Drakon() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#ifdef Clion
    freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
#endif
}

unsigned long long inf = 1e10;
const double EPS = 1e-6;
const int MOD = 1000000007, N = 200005, LOG = 25;

ll gcd(ll x, ll y) {
    return y ? gcd(y, x % y) : x;
}

ll lcm(ll a, ll b) {
    return (a * b) / __gcd(a, b);
}

ll mul(const ll &a, const ll &b) {
    return (a % MOD + MOD) * (b % MOD + MOD) % MOD;
}

ll add(const ll &a, const ll &b) {
    return (a + b + 2 * MOD) % MOD;
}

ll pw(ll x, ll y) {
    ll ret = 1;
    while (y > 0) {
        if (y % 2 == 0) {
            x = mul(x, x);
            y = y / 2;
        } else {
            ret = mul(ret, x);
            y = y - 1;
        }
    }
    return ret;
}

void solve() {
    string a, b;
    cin >> a >> b;
    int x = 0, y = 0;
    string ans;
    while (x < a.size() && y < b.size()){
        if(a[x] < b[y]){
            ans += a[x ++];
        }
        else{
            ans += b[y ++];
        }
    }
    while (x < a.size())ans += a[x ++];
    while (y < b.size())ans += b[y ++];
    cout << ans;
}

signed main() {
    Drakon();
    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
}

详细

Test #1:

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

input:

ahjmnoy
acijjkll

output:

aachijjjkllmnoy

result:

ok single line: 'aachijjjkllmnoy'

Test #2:

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

input:

a
a

output:

aa

result:

ok single line: 'aa'

Test #3:

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

input:

aaaabbccddeeeefghijjknnnoopqrssssstttuuvwwxxxyyyyy
abbcefgghiiiiiijjjllllmmnnooqqrssttuvvwxxxxxyyzzzz

output:

aaaaabbbbcccddeeeeeffggghhiiiiiiijjjjjkllllmmnnnnnoooopqqqrrssssssstttttuuuvvvwwwxxxxxxxxyyyyyyyzzzz

result:

ok single line: 'aaaaabbbbcccddeeeeeffggghhiiii...tttuuuvvvwwwxxxxxxxxyyyyyyyzzzz'

Test #4:

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

input:

aaaaabcdegghhhijlllmmnnnooppppqqrrrrssttuvwwwxyyzz
aabbbbccgggggijjjjlllmmmnnooppqrtttuuuvvvwxxxxxyzz

output:

aaaaaaabbbbbcccdeggggggghhhiijjjjjllllllmmmmmnnnnnooooppppppqqqrrrrrsstttttuuuuvvvvwwwwxxxxxxyyyzzzz

result:

ok single line: 'aaaaaaabbbbbcccdeggggggghhhiij...stttttuuuuvvvvwwwwxxxxxxyyyzzzz'

Test #5:

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

input:

aaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz
a

output:

aaaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz

result:

ok single line: 'aaaaaabbbbcdeeeffggggghhhhiiii...sssttttuuuvvvwwwwwwwwwxyyyyzzzz'

Test #6:

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

input:

aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzz
z

output:

aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzzz

result:

ok single line: 'aaaaaabbbbbbccccddeeeefggggggh...ttuuuuuvvvvwwwxxxxxxxxyyyyyyzzz'

Test #7:

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

input:

z
aaaaaabbbccdeefgggghhhhiiiiiiijjjjlllllllmmmmnnnnnooooppppqqqqrrrrrssssttttuuvvvwwwwxxxxxxyyyyzzzzzz

output:

aaaaaabbbccdeefgggghhhhiiiiiiijjjjlllllllmmmmnnnnnooooppppqqqqrrrrrssssttttuuvvvwwwwxxxxxxyyyyzzzzzzz

result:

ok single line: 'aaaaaabbbccdeefgggghhhhiiiiiii...sttttuuvvvwwwwxxxxxxyyyyzzzzzzz'

Test #8:

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

input:

aaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz
aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzz

output:

aaaaaaaaaaabbbbbbbbbbcccccdddeeeeeeefffggggggggggghhhhhiiiiiijjjjjjjjjjkkkllllllllmmmmmnnnnnnnnnnnooooooooopppppppppqqqqqqqrrrrrrrssssssssttttttttttuuuuuuuuvvvvvvvwwwwwwwwwwwwxxxxxxxxxyyyyyyyyyyzzzzzz

result:

ok single line: 'aaaaaaaaaaabbbbbbbbbbcccccddde...wwwwwwxxxxxxxxxyyyyyyyyyyzzzzzz'

Test #9:

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

input:

aaaaaabbbccdeefgggghhhhiiiiiiijjjjlllllllmmmmnnnnnooooppppqqqqrrrrrssssttttuuvvvwwwwxxxxxxyyyyzzzzzz
aaaaaabbbbbbccccddeeeefgggggghiijjjjjjklllmmmnnnnnoooopppqqrrsssssttttttuuuuuvvvvwwwxxxxxxxxyyyyyyzz

output:

aaaaaaaaaaaabbbbbbbbbccccccdddeeeeeeffgggggggggghhhhhiiiiiiiiijjjjjjjjjjkllllllllllmmmmmmmnnnnnnnnnnoooooooopppppppqqqqqqrrrrrrrsssssssssttttttttttuuuuuuuvvvvvvvwwwwwwwxxxxxxxxxxxxxxyyyyyyyyyyzzzzzzzz

result:

ok single line: 'aaaaaaaaaaaabbbbbbbbbccccccddd...xxxxxxxxxxxxxyyyyyyyyyyzzzzzzzz'

Test #10:

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

input:

aaaaabbbbcdeeeffggggghhhhiiiijjjjkklllllmmnnnnnnoooooppppppqqqqqrrrrrsssttttuuuvvvwwwwwwwwwxyyyyzzzz
aaabceehiillmnorrtv

output:

aaaaaaaabbbbbccdeeeeeffggggghhhhhiiiiiijjjjkklllllllmmmnnnnnnnooooooppppppqqqqqrrrrrrrssstttttuuuvvvvwwwwwwwwwxyyyyzzzz

result:

ok single line: 'aaaaaaaabbbbbccdeeeeeffggggghh...stttttuuuvvvvwwwwwwwwwxyyyyzzzz'

Test #11:

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

input:

z
a

output:

az

result:

ok single line: 'az'

Test #12:

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

input:

a
z

output:

az

result:

ok single line: 'az'

Test #13:

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

input:

aabeehiklmmsy
aaabceehiillmnorrtv

output:

aaaaabbceeeehhiiiklllmmmnorrstvy

result:

ok single line: 'aaaaabbceeeehhiiiklllmmmnorrstvy'

Test #14:

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

input:

ahijjmmnory
aabeehiklmmsy

output:

aaabeehhiijjklmmmmnorsyy

result:

ok single line: 'aaabeehhiijjklmmmmnorsyy'

Test #15:

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

input:

aaaaabcdegghhhijlllmmnnnooppppqqrrrrssttuvwwwxyyzz
hjno

output:

aaaaabcdegghhhhijjlllmmnnnnoooppppqqrrrrssttuvwwwxyyzz

result:

ok single line: 'aaaaabcdegghhhhijjlllmmnnnnoooppppqqrrrrssttuvwwwxyyzz'

Test #16:

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

input:

ahijjmmnory
bbbeeffggghiiijjjkkllnnnoooppqqqrsttuuvvwwwwwwyyzz

output:

abbbeeffggghhiiiijjjjjkkllmmnnnnooooppqqqrrsttuuvvwwwwwwyyyzz

result:

ok single line: 'abbbeeffggghhiiiijjjjjkkllmmnnnnooooppqqqrrsttuuvvwwwwwwyyyzz'

Test #17:

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

input:

aabbbbccgggggijjjjlllmmmnnooppqrtttuuuvvvwxxxxxyzz
aabeehiklmmsy

output:

aaaabbbbbcceeggggghiijjjjkllllmmmmmnnooppqrstttuuuvvvwxxxxxyyzz

result:

ok single line: 'aaaabbbbbcceeggggghiijjjjkllllmmmmmnnooppqrstttuuuvvvwxxxxxyyzz'

Test #18:

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

input:

aaabceehiillmnorrtv
aaaabbccddeeeefghijjknnnoopqrssssstttuuvwwxxxyyyyy

output:

aaaaaaabbbcccddeeeeeefghhiiijjkllmnnnnooopqrrrsssssttttuuvvwwxxxyyyyy

result:

ok single line: 'aaaaaaabbbcccddeeeeeefghhiiijj...ooopqrrrsssssttttuuvvwwxxxyyyyy'