QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#492540#162. Merges and AcquisitionsAfterlife#AC ✓0ms3832kbC++17595b2024-07-26 13:23:192024-07-26 13:23:19

Judging History

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

  • [2024-07-26 13:23:19]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3832kb
  • [2024-07-26 13:23:19]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
string s , t;
bool chk(string s,string a) {
    int cur = 0;
    for(int i = 0;i < a.size();i++) {
        while(cur + 1 < s.size() && s[cur] != a[i]) cur++ ;
        if(s[cur] != a[i]) return 0;
        cur++ ;
    }
    return 1;
}
int main() {
    ios::sync_with_stdio(false) ; cin.tie(0);
    cin >> s >> t;
    string a , b;
    for(int i = 0;i < s.size();i++) {
        if(i & 1) a += s[i];
        else b += s[i];
    }
    if((chk(s,a) && chk(t,b)) || (chk(t,a) && chk(s,b))) cout << "Yes\n";
    else cout << "No\n";
}

詳細信息

Test #1:

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

input:

acmicpc
tsukuba

output:

No

result:

ok single line: 'No'

Test #2:

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

input:

hoge
moen

output:

Yes

result:

ok single line: 'Yes'

Test #3:

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

input:

abcdefg
xacxegx

output:

Yes

result:

ok single line: 'Yes'

Test #4:

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

input:

bbaaabba
bababaaa

output:

Yes

result:

ok single line: 'Yes'

Test #5:

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

input:

abbbabbbaaaabaabbaaab
babaaabbbababbbbbbbba

output:

No

result:

ok single line: 'No'

Test #6:

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

input:

aaaab
abccb

output:

No

result:

ok single line: 'No'

Test #7:

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

input:

cbcbcaccbabaabaab
bbbbbaaabcbabcacc

output:

No

result:

ok single line: 'No'

Test #8:

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

input:

cbabdbdbdbaabcc
bccabcabcaabdcd

output:

No

result:

ok single line: 'No'

Test #9:

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

input:

bbacbacbacbb
bbbcacdddcdd

output:

No

result:

ok single line: 'No'

Test #10:

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

input:

ccbedcdceeddbbebbcbeeddd
ecdceeedeeadaacdacddaabb

output:

No

result:

ok single line: 'No'

Test #11:

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

input:

bccbebbbebdcdaebb
bacdacddaebdcacad

output:

No

result:

ok single line: 'No'

Test #12:

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

input:

abfcedbacefaafc
bccabfacbbbffcf

output:

No

result:

ok single line: 'No'

Test #13:

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

input:

d
d

output:

Yes

result:

ok single line: 'Yes'

Test #14:

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

input:

cbegeccgfedcag
addgbggaacbbdg

output:

No

result:

ok single line: 'No'

Test #15:

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

input:

ebefgdcgecadecffbccdeg
fccggegafdecfegffdaefc

output:

No

result:

ok single line: 'No'

Test #16:

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

input:

dcd
heh

output:

No

result:

ok single line: 'No'

Test #17:

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

input:

agddff
cdfbbd

output:

No

result:

ok single line: 'No'

Test #18:

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

input:

ehbbfdieaie
dchigebgiea

output:

No

result:

ok single line: 'No'

Test #19:

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

input:

dbfahbhdgcifcihaabghcfica
ddhbcddgeedfgaihadecaddcb

output:

No

result:

ok single line: 'No'

Test #20:

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

input:

cbfhhceadcdiahiighihbaebefegh
dacdhhgjijjbdhjgggigbgbcjiabd

output:

No

result:

ok single line: 'No'

Test #21:

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

input:

fbaiejbcia
ggfefdifcg

output:

No

result:

ok single line: 'No'

Test #22:

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

input:

ibeifkbggcffahcabcgikfccad
kkkiaackbcgcjddigkkcgkjkfd

output:

No

result:

ok single line: 'No'

Test #23:

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

input:

fgfdhf
agibke

output:

No

result:

ok single line: 'No'

Test #24:

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

input:

bbbbbaabbabbaabbabbbbaaabbbbbbaabaabaaabbabbababaaaababaabbbaaababbbbaaabbbbbaabaabbaaaababbbaaaababbaaabbbbbbbababbaabbaababbbaaaaabbbbaaaabaabaabaaaaaabbaabaabbaabbaabaabaababbbabbaaaaabababbbbbaaaabbbbaabaabbbababbbbbabaababaabaaaabbbbabaabbbabbababbabbaabaaabbaabababbaabaabaababbbabbabbbabbbbbab...

output:

No

result:

ok single line: 'No'

Test #25:

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

input:

bbbabbbaaabaabaabbabbabaababbbaaabbbbaabababbaabbbaaaabbabababbbbbbaabaaababbaaaaabbbaaabbaabbbbbbabbaabaabbaaabababbabaaaaaabaaaababbbaabbabbaaaabbaaababbababbaabaaabbbaabbbaabbabaaaaababaabaabaaaabbbabaaaaaaabababaaaaabbababbaababbabaabaabaaabaaaabbaaabaababbaaaabbbbbbbbbbbabbbbbbbabbbbaabaaabaabb...

output:

Yes

result:

ok single line: 'Yes'

Test #26:

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

input:

abaababbabbbabbaaaaabbaabbbbaabbbabbaaaaaabaaaaaabaabbbbaaaaaabbabbaaaaaabbabaabbbaababaaababbabbbabbabaaaababbaabaababaaabaaabbaaababaabbbbbaabbababbabbababbbbaababaaaaababababbaaaaabbaaabbaabbaaabbbaaabaaabaaabbbbbbbbabaaabbbbaabbbbaabbbbaababbbbbbabaaababbaaaabbbbbabbbbabbababbaaabbbaaababaaabbaa...

output:

Yes

result:

ok single line: 'Yes'

Test #27:

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

input:

aaaabbaabababababbabbaabbbbaabbbbaaabbbaababbaabaabaaababaabbbaaabaaaaabbaaabababbbbababbabaaaaaabbbababbbbbbbbbbbaaabaabbabaabbabbaaaaabbaaabbabbaaabbbabbbaabaabaabbaababaabbbbaabbbbabaaabbbbaaabaababaabbaaaabbababaabbbbbbbabbababbaabbbaaababbbbbaabbbbbaaabaaabaaabbaabbaababbbababbaaabababaabbabbaa...

output:

Yes

result:

ok single line: 'Yes'

Test #28:

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

input:

bbbbabbaabbaababbabbabbbbbabbaaabbbbabbaabaaababbbabbbaabaabbbbbaababaabbaaababbababbaaaabaaabbabbbaabaaaabbababaababbbabaaaabaabbababaaaaababaaabbababababababaabaabbabbbbbbaaabbaabbababbababaabaaaaababbbabbbababababbaabbaaababbaaaaaaabaababbbbaaabababbaaabbbbbbbbabaabbabbbbaaaaaaabbababaababbbabbbb...

output:

Yes

result:

ok single line: 'Yes'

Test #29:

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

input:

abaaaabbbbbbaabbabbbbbabbabbaaaabaaaabaaaaaaaabbbbabaabaaabbaabbbabababaaabaabbabbbabbbabbaaabbbabaaaaabababbbbbbbaabbabaabaabbabaaaabbbbbabaabaaaabaabbaabbbbaabaabbabbababaabaabbbbaaaaaaabbbaabaabaababbbbababbbabbbabaaabbabbaaaaaabbababbbabaaaabaabaaabbbaababaaababababaabbabbaabbbbababbbaaabbbbbaaa...

output:

Yes

result:

ok single line: 'Yes'

Test #30:

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

input:

bbaaaabaababaabbababaabbbabbaaaaaaabaabbabbabaaaaaaaabaaaabbbaaaaabaaaabbbbbbabaabbbaabbbbbababbaaabaababaabbabbababaaabaaaabaabaabbabbababbbaaabaaaabbaaaaaaaabaaabaabaababaaabbaababaababbaababbabbbbbbaababaaabbababaaababbababbaaabababbbaaabbabbabbaabaababbbbabababababbbaabaababbabaaabaaaabbaababbab...

output:

Yes

result:

ok single line: 'Yes'

Test #31:

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

input:

abbababbababaaababbabbbaabbabbbbababaabaabbaaaaabaaabaabbabbbbbbababbabaaaaaabaaabbbbbabbbabaabbaabbabaabbabaabbbbaaaaaaaaabbabbaaabbbababaaaaabbabaaabbabbabaabbbbaababaaababbaababbbbbbabaaabbbabbbbbbbabaaababbbbaaababbaababbbaaaabbababaabbabbbabbbabaaaaabbbbabababaabbababaaaabbabbabbaabaabbabbbbaaa...

output:

Yes

result:

ok single line: 'Yes'

Test #32:

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

input:

aabaaabaabaababaababbabaaaababbbaabbabbabaaabababaaabaaaaaaaaaabbabaabbbaaababbaaaabaaababbabaaaabababbbaaaaaaabbbaaaaabababaabaaaabbbababbbbbabbababbbbbaabaaabbabbaabaaabbabbababaabaabaabbbabbbabbbaaabbbabbababbbabbabbbaaababaabbabaabbaaaaabbaaabbbaaabbaaaaaaaabbaabaababaabbabbbaabbbaaaaaababbaaaba...

output:

Yes

result:

ok single line: 'Yes'

Test #33:

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

input:

baaaabbababaabaabababbbaaaaabaabbbabbaaaabababbabbbbaaaaabbbbababbbababaabbbabbbabaaaaabbbbbabbbbabbbabbbaaaabbaabbbaaaaabbbbababbbabbbbaaabbbaaaababaabaabaaababbbbabbabbaaaaaaaaaabaababbabbabbbbbbbbbbabbaabaaabaabaaaababbabaabaaabbbbbaabbaaaaababbbababaaabbbbaaabaaabaabaaabaabaaaaaaaaabaaabbabaabab...

output:

Yes

result:

ok single line: 'Yes'

Test #34:

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

input:

bbbabbbbabaabbabbbbbbbabaaabbabbbbabbabbbaabaaabbabbaabbaaaaaaabaabbbbaabbaabaaabbbabaaabbbabbaaaabbbababaabaaabbbbabaaabaabbaaabbabaabaabbaaabaababbaabaaababaababbaaaaabaaabaaaabbaabaabaabaaabbaabbaabbaaabbbbbbbaababaabbbabababaaaaabbaabbbbbaaabaabbbbbabbaaaabbabaabbbabaaaaaabbbaaababbabbababbababb...

output:

No

result:

ok single line: 'No'

Test #35:

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

input:

wbcdugsigbadgwdjcnznraospkxxjtkbratqjyupbkhzsccsfpmmlzjfwzybbwlwlzxzftnfjnzjkuuypxbzizfbjwfpriboezxebcrqkufavpvuitlwzrriqyuijtyggvqrrrugybqgrkmymqsohyugnrunqqwmcmxljvcyrmqxvjxixlfvjvffqtwqnubytbafwrxipedrjjqzxdwdgmfltisbghorrcoguarlsqqvhnptgwaapiatqqumjtygqnmhmuyezlpawpzkkzecjspopwsbczuwjtoalvvvbovh...

output:

No

result:

ok single line: 'No'

Test #36:

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

input:

ababbabbbabbbbaaabbabababbaaabbababbaabbaaababbbbaaabababbbbaabbbbabababbbabababbbbaaaaaaaaaabaabaabbabaaabaaaaabbbbabaaabaabbbbbabaaaabaaaaabaabbbabaabaaaaabbbbbbababbaabbabaaaaabababbbababbaaabbbbababbabbabbabaabbaabbbaabbbaabaababbaabbbabbababaaaabaabaabbaaabababaaabbaaaaabbaabababbbaabbbabbaabba...

output:

No

result:

ok single line: 'No'

Test #37:

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

input:

abbaaaabbbaaaaaabbbbaaaaaabbbbbbabbaaaaaabbabaaabbaaaabbaaaabbabbabaaaaaaabaaaababbbabaaaababaaaaabbaaaabaaaababbaabbabbbaabaabbabbbabbaaabababbaababaaaabbabbaabbaabbbaaaaaabaabaaabbabaaabaaaabaababbbaaaababbabbaabbaabababbbbbaaaabbabaaaaababbbbbabbbaaaaabbaaaabbbbbbaabbbbaaaabbaabbbbabbaaabbabbbaaa...

output:

Yes

result:

ok single line: 'Yes'

Test #38:

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

input:

aaaaaaabbbbababbbaaaababaababbaaababbabbbabaaaabbababbaababbbbabbbaabbababaaaaaaaaababaabbbbaabaabbbaabaaabababbbaabaabbaabababababbbbbabbaabbbabbaababbbbaaababbbbbaaabaabaabaabaaabaabbaaaaaabbbabaaababaabbabaaaaaaaaaaababbbababbbaababbbbbaabbaaabbaaaaaababaababaabbababbbabbbabbabaaababbaaaaabaababb...

output:

Yes

result:

ok single line: 'Yes'

Test #39:

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

input:

bbabbbbababbbbbabaabaaababbabbbbbbbbaaababbaabaaabbabbabbaaaaaabbaaaaabaabbababbbbbabababbbbbbbabbababaababbaaaabaaabababbaaababbbabababababaabaaababababaabaabbaaaabaababbababbbaabbbababaababbabaaabbaabaababaabaaaababbaaaaabaaabbabbaaaaabaaabbabaaabaababaaaaababbbabaaabbbaaaabbbbbbbabbababbaabaabaaa...

output:

Yes

result:

ok single line: 'Yes'

Test #40:

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

input:

stststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststst...

output:

Yes

result:

ok single line: 'Yes'

Test #41:

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

input:

ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss...

output:

Yes

result:

ok single line: 'Yes'

Test #42:

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

input:

tstststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststststs...

output:

Yes

result:

ok single line: 'Yes'

Test #43:

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

input:

sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
tststststststststststststststststststststststststststststststststststststststststststststststststststststs...

output:

Yes

result:

ok single line: 'Yes'

Test #44:

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

input:

ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss...

output:

Yes

result:

ok single line: 'Yes'

Test #45:

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

input:

m
a

output:

Yes

result:

ok single line: 'Yes'

Test #46:

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

input:

abab
aaaa

output:

Yes

result:

ok single line: 'Yes'

Test #47:

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

input:

abab
bbbb

output:

Yes

result:

ok single line: 'Yes'