QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#471972 | #7234. Pencil of Wishing | propane | WA | 235ms | 11132kb | C++20 | 2.5kb | 2024-07-11 12:27:01 | 2024-07-11 12:27:01 |
Judging History
answer
// https://www.luogu.com/article/rvn2qn8x
#include<iostream>
#include<cstring>
#include<vector>
#include<tuple>
#include<algorithm>
using namespace std;
using LL = long long;
int main(){
#ifdef LOCAL
freopen("data.in", "r", stdin);
freopen("data.out", "w", stdout);
#endif
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(0);
string s, t;
cin >> s >> t;
const int n = s.size(), m = t.size();
vector<vector<int> > lcp(n + 1, vector<int>(m + 1));
for(int i = n - 1; i >= 0; i--){
for(int j = m - 1; j >= 0; j--){
if (s[i] == t[j]){
lcp[i][j] = lcp[i + 1][j + 1] + 1;
}
}
}
const int INF = 1e9;
vector<vector<int> > dp(n + 1, vector<int>(m + 1, INF));
vector<vector<pair<int, int> > > pre(n + 1, vector<pair<int, int> >(m + 1, {-1, -1}));
int l = -1, r = -1, x = -1, mn = INF;
dp[0][0] = 1;
for(int i = 0; i < n; i++){
for(int j = 0; j <= m; j++){
dp[i + 1][j] = min(dp[i + 1][j], dp[i][j]);
}
for(int k = i + 1; k <= n; k++){
int nxt = m + 1;
for(int j = m; j >= 0; j--){
if (lcp[i][j] >= k - i){
nxt = j;
}
if (dp[i][j] > INF / 2) continue;
int val = dp[i][j] + k - i + 1;
if (i == 0){
val -= 1;
if (nxt != 0) nxt = m + 1;
}
if (k == n){
val -= 1;
int len = k - i;
if (m - len < 0 or lcp[i][m - len] < len){
nxt = m + 1;
}
}
if (nxt > m){
if (val < mn){
mn = val;
l = i;
r = k;
x = j;
}
}
else if (val < dp[k][nxt + k - i]){
dp[k][nxt + k - i] = val;
pre[k][nxt + k - i] = {i, j};
}
}
}
}
string ans;
if (r != n) ans += "*";
while(l >= 0){
for(int i = r - 1; i >= l; i--){
ans += s[i];
}
if (l != 0) ans += "*";
while(l > 0 and dp[l][x] == dp[l - 1][x]){
l -= 1;
}
r = l;
tie(l, x) = pre[l][x];
}
reverse(ans.begin(), ans.end());
cout << ans << '\n';
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3556kb
input:
aabb ab
output:
aa*
result:
ok correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
abaabaaabbbaabbb abaabbbaabaaabbb
output:
abaaba*
result:
ok correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
amuletofyendor amuletofshmendor
output:
*y*
result:
ok correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
spbau spbsu
output:
*a*
result:
ok correct
Test #5:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
b abaabaaaabaababbabba
output:
b
result:
ok correct
Test #6:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
bbaabaaa babbaabbbbababbaaab
output:
*a
result:
ok correct
Test #7:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
abb baabababababbbb
output:
a*
result:
ok correct
Test #8:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
baaaaaaa abaabbbaabbbba
output:
b*
result:
ok correct
Test #9:
score: 0
Accepted
time: 7ms
memory: 4100kb
input:
aaabbababbbabaaaaabababaabaabbbbaaabbabbabbbaaaabaabaaabbbaabbaaaabbabbabaababbaabbbabaabababbabbbbbbababbaaabbababbaababaabbbbbababbaaaabaabbabaababbabbbbaaababbbabbabbaabb aabbbbbabbbaaababababaaaaabbbababbaaabababbbaabababbaabbaaabaaaabaaababaabaabbabaabaaaabbbaaababaabbbbbbbbaaaaaaaabbaaaaabbaab...
output:
*b
result:
ok correct
Test #10:
score: 0
Accepted
time: 1ms
memory: 3768kb
input:
bbaabaabbaaaabbbbabbaababababbbbababaaaa abaabbaabbaaabbbaabaababaaaababbbbbbababbbaabbbabbbbbabababaabbababaabbbbbbbbaaababababaaababababbbabaababababaabababbaaaaaaaabbaaabbaabbbbaaabbbbbaaaaaaaaabababaaababbbbabbbbaaabbaaaababbaaababbbaaababaaaaabbbbbabaaabaabababbababababbabbaababbbabbaabbbbbbbab...
output:
b*
result:
ok correct
Test #11:
score: 0
Accepted
time: 18ms
memory: 4832kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...
output:
*babbabaabb*babbabaabbaababbab*abaababbaabbabaabb*
result:
ok correct
Test #12:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
aaaaaabbaaayxybbaaaaabbbb aaaaaabaaaayxybbaaaaaabbb
output:
*bbbb
result:
ok correct
Test #13:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
bbbbaaaaabbyxyaaabbaaaaaa bbbaaaaaabbyxyaaaabaaaaaa
output:
bbbb*
result:
ok correct
Test #14:
score: 0
Accepted
time: 1ms
memory: 3984kb
input:
bbbaabbbabaaabbbaababbabbbabbaaabbbbbaababb bbbbbabbabbaaabaabbbababbbabaabaabbbbabaaaaabbabbbabababaaabaabbbbaaaaabaaaaabaaaabbbbabbaabababbbbaaaaabbabaaaabbabbbbbbaaaaaabaaaabbaababbbabbbbbaabbbabbabaaaaababaabaabbabbbabbbbbbabbababaabbaaaabbaaabbaabaababababbaabbababbabbaabaabbabbbbaabbaabaabbaba...
output:
*bb
result:
ok correct
Test #15:
score: 0
Accepted
time: 159ms
memory: 9544kb
input:
baabaabaabbbbaaaaabaaababbabbbbbaaaaabbbabaaaabaababaabbbbbabbbbababaabbabbabbbbaaaabbabaaababaabbbaabbbabbabbabaabaaaabbaaabaaaaabaaaabbbbabaabbbaabbaaabbbbabaabaabababaabbbbabaaabbaaaaababaaaababbabababaabbabaaababbaaaaaaaababbbaabaaabababbbbbabbbbbabbbababbbaabbaaabaababbbbabaaaabbbabbbaaababaaba...
output:
b*
result:
ok correct
Test #16:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
abaab abbab
output:
aba*
result:
ok correct
Test #17:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
abbaababba abbabaabba
output:
abbaa*
result:
ok correct
Test #18:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
abbabaababbaabbabaab abbabaabbaababbabaab
output:
*abaaba*
result:
ok correct
Test #19:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
abbabaabbaababbaabbabaababbabaabbaababba abbabaabbaababbabaababbaabbabaabbaababba
output:
*bbaababbaa*
result:
ok correct
Test #20:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
abbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaab abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaab
output:
*aabbab*aabbabaabb*
result:
ok correct
Test #21:
score: 0
Accepted
time: 3ms
memory: 3904kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababba abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabb...
output:
*aabbab*aabbabaabb*bbaababbab*
result:
ok correct
Test #22:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
abbab abaab
output:
abb*
result:
ok correct
Test #23:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
abbabaabba abbaababba
output:
abbab*
result:
ok correct
Test #24:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
abbabaabbaababbabaab abbabaababbaabbabaab
output:
*abaabb*
result:
ok correct
Test #25:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
abbabaabbaababbabaababbaabbabaabbaababba abbabaabbaababbaabbabaababbabaabbaababba
output:
*bbaababbab*
result:
ok correct
Test #26:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaab abbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaab
output:
*aabbab*aabbabaaba*
result:
ok correct
Test #27:
score: 0
Accepted
time: 3ms
memory: 4196kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababba abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabb...
output:
*babbabaabb*bbaababbaa*babbaa*
result:
ok correct
Test #28:
score: 0
Accepted
time: 18ms
memory: 4660kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...
output:
*aabbabaabbaababbab*abaababbaabbabaaba*aabbabaaba*
result:
ok correct
Test #29:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
c baccaab
output:
c
result:
ok correct
Test #30:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
cbbaacccaaaacaaabbac bcbaa
output:
c*
result:
ok correct
Test #31:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
bcabbbbaab acbb
output:
b*
result:
ok correct
Test #32:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
abbba abbaaabbbcaacbccbca
output:
*ba
result:
ok correct
Test #33:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
bbba abbabbacacaccbaacaaa
output:
b*
result:
ok correct
Test #34:
score: 0
Accepted
time: 3ms
memory: 3812kb
input:
babaacbaaacbaccaabcaccbbaccaaabbabbccbbbacababacaccbcaacccbbaacabbcccbcbcbbaabbacccbccbbcbbbabbabcbbcaacacaccabccbcabcbaacccacaaccbaaaccbacaacbbbbcaba cabaaaacaabbcbacbbccaabacacabcbbabaabcabcbccaabccccbccbcbccaaabcccccacbcaacbcbaaccabbbcbcaaccbabcaaccacabbbccaccccacacbbacaacbbcacbbbbcbaabacabbababa...
output:
b*
result:
ok correct
Test #35:
score: 0
Accepted
time: 109ms
memory: 8492kb
input:
cbcacacbbbbcbbccaabbcccbaaacabcbbabaccbbabbaacccacababaaaabbbbcbcbcccbbcccaccbcccbabcabcbbbcbaacbbbcaccbbbcbbabacccacaaaaabcaaaccaccbbbbcbccabcacaaccaacacccababacaccabcccacbcaabbbbcabacaabacaaaabcaccbabbccabcbcacccbcacaabaacccbcbaccbbabaabcbcbabbbabcbaabababbbcbbcaacabcccccbcababbccabcbcabaacbbbccbb...
output:
c*
result:
ok correct
Test #36:
score: 0
Accepted
time: 144ms
memory: 8856kb
input:
bacbaabcccccabacbaaaabbbcbacbabcabbaccabbccacabbaabcacbccbababbbbacbcbbbcacaabababaccacbacacbaabccabcccbcbcbbacababcacaabcbbbcabbbaaacabaaacaccccbbbaaabacccacbbbbbaabbababbacbcaaacaabcccbbcacccbaacaababcbbbbcbaaccbabbacccaccbbabbbcaaccbbaaabccaabcabbbbaacbccccbaccbabcbcbbcabacacaabcabbcbbbaabaabcbaa...
output:
b*
result:
ok correct
Test #37:
score: 0
Accepted
time: 5ms
memory: 3836kb
input:
bacacabcaaaacbbabbcbbbaccabbbccccccabbbccabbabcabcccabbbbaacccbccaccacaabcaacbcbaababbcabcaccabcaaabbaabaacccaccccbcbabababcabcbbabacbacccbacabaacacbbacccaaccbbcaacccbaacacaccabacbbbccccbcccabbcccabbacbbaaaaccaaabccbbacbaacbcbcacccbaa aaabbcbbcacaccccccbacacbabcccbbacbbbcacacaccccaaaaaabbbbcbccbbcca...
output:
b*
result:
ok correct
Test #38:
score: 0
Accepted
time: 14ms
memory: 4524kb
input:
aaabacbccabbcbcacaaabababccbabbbacccccbbcbbaaacbabbcaaccabacbbacacaacbcacbbacbacccabcbacaaabbacbccbbabbccaabbbabccabbaabbbbcaccccabaabbbcbacacabbcaaaaaacaccbcabcccaacbaacbccabccbbbbbcabbbbbcbcccbcbaaacccaccccbcbbcbcaaccacbabcaaabacabaacbcbbabbcbcbcbacaaaccaccaccccbacabaababbbcccbbcbabacbbbbbccbbcaac...
output:
*b
result:
ok correct
Test #39:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
lflpycarhnsyy dsiouaolhlzmpy
output:
l*
result:
ok correct
Test #40:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
ktoph mepp
output:
k*
result:
ok correct
Test #41:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
gsnjrwbwyyrso whodehlflazqn
output:
g*
result:
ok correct
Test #42:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
rstjl j
output:
r*
result:
ok correct
Test #43:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
likiiaihmmmdneaey kq
output:
l*
result:
ok correct
Test #44:
score: 0
Accepted
time: 17ms
memory: 4568kb
input:
qwaiqvnrejukzzrxckcbxiluoulcdonjpxbnaunwwacsgzwtnxikrsnjesjqtvkhefzzxosmuesorinxoetsqrqztqgkmfiqbbudrszmguofdqakaeqycnljohzgjiuchxevoidrufeaohhcqavibrmavlfxjkuvjavvyooffmldoddesijwasteapqthtllclksecfsqorakqgqmzwhggvcyhfycjmmgbdolqcfeswtuajjejdkihxaiozbaqvowxcidchldrjvthachxcpqdzszacixfvrdafowwusccdf...
output:
q*
result:
ok correct
Test #45:
score: 0
Accepted
time: 9ms
memory: 4092kb
input:
omhuwyukjnwytkqaqeinjoxxsmnmcuneqhdscyaqwchqiteyicrvetqhpmkppnwjzqsgqnhjldzlojfxdranfgkaivwqaxxdkzsyphzhlzcfesbvfbyrkqyjzuhtwbwlxfyttojbtesytfutoevsglvnimdapmwqvdeliqizhapbobctjatcuifjfuaekyijodzqbgzgtfysmzgophxvlrpqagbpoacpvxhwsytsestcibeqyezdpvi hkelcasxpjysyuauiueibapyqbbnwtlinxryuzmwwckmqyigebhe...
output:
o*
result:
ok correct
Test #46:
score: 0
Accepted
time: 8ms
memory: 3924kb
input:
nqjciwgodkpnbtehhvwlhfzrjajgrvwfzysxtkxrvkinqdncfhpgzvemleajfgctjragnjmllqbbytukmueamclxwqtgpqqpefxtmqccmzmxzdpvllwqiyokuaohilfdepuxzvowcuhhrvexzfzslxxzjtshlgcjynxkzlninjpeyridotayrmlhoczqqokzvjxkwwqmohahtnpihgdbkfgtwaxpzxgovinahhazlemawxqwxswjnvhremqrc sxlfhwlruoqqztntciugaucppzctrcphctlelmrrwwjbaz...
output:
n*
result:
ok correct
Test #47:
score: 0
Accepted
time: 176ms
memory: 10508kb
input:
tiupunfbiiscxbjfpuegqjwvbouywzvnjcbdiktvumuqqztqfjzqhyuykgooryhdyqtbempubutwovfkaykhagzyeljpdpqqyhhfiimkvexnuoxjblyuznxgzrjkzybpwfrspfiscyunxoembspdzuiviqqtgxihqqhtwrwixogfdvwqugpsqedfdfxrpckwsmxerbthscwyxcsaywnrnfqauowenpaysjnxbtperzmyeivehcrcvbhnlrjzcxuopxguwodyebmitnztvshpnpcdyqpwddrebhbbbbsivkxd...
output:
t*
result:
ok correct
Test #48:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
ejiefhutyzamobntnorglkiqdcei fzsixfuohiwvvpmglnizuyqpbfnyfefksgpuukpdyoubtftrpwwznwwyxnfktiblqtjmxltijzvyxuhdaxovggpswazsibugtjtszpllotibwwevuoftrbewpyulyogtaqmujsjcxwjjvfipftikjjjkdtxymxlclnbycxoyjwzitwlwaaqcnapiizodxjmiextuscgeorhoauunyvjejnnyqmgfieleugzmckdawbpszmbb
output:
e*
result:
ok correct
Test #49:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
ababab abbaab
output:
aba*
result:
ok correct
Test #50:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
abbaabbaabba abbabaababba
output:
abbaa*
result:
ok correct
Test #51:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
abbabaababbabaababbabaab abbabaabbaababbaabbabaab
output:
*abaaba*
result:
ok correct
Test #52:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
abbabaabbaababbaabbabaabbaababbaabbabaabbaababba abbabaabbaababbabaababbaabbabaababbabaabbaababba
output:
*bbaababbaa*
result:
ok correct
Test #53:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
abbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaab abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaab
output:
*abaababbaabbabaaba*
result:
ok correct
Test #54:
score: 0
Accepted
time: 4ms
memory: 4288kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababba abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaa...
output:
*aabbab*aabbabaabbaababbaa*babbaa*
result:
ok correct
Test #55:
score: 0
Accepted
time: 29ms
memory: 5352kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabba...
output:
*babbabaabb*babbabaabbaababbabaababbaabbabaaba*aabbabaaba*
result:
ok correct
Test #56:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
abbaab ababab
output:
abb*
result:
ok correct
Test #57:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
abbabaababba abbaabbaabba
output:
*bab*
result:
ok correct
Test #58:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
abbabaabbaababbaabbabaab abbabaababbabaababbabaab
output:
*aabb*
result:
ok correct
Test #59:
score: 0
Accepted
time: 0ms
memory: 3908kb
input:
abbabaabbaababbabaababbaabbabaababbabaabbaababba abbabaabbaababbaabbabaabbaababbaabbabaabbaababba
output:
*babbab*
result:
ok correct
Test #60:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaab abbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaab
output:
*aabbabaabb*
result:
ok correct
Test #61:
score: 0
Accepted
time: 4ms
memory: 3936kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababba abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabb...
output:
*babbabaabbaababbab*
result:
ok correct
Test #62:
score: 0
Accepted
time: 28ms
memory: 5380kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabba...
output:
*aabbabaabbaababbabaababbaabbabaabb*
result:
ok correct
Test #63:
score: 0
Accepted
time: 212ms
memory: 11128kb
input:
aabbabbabbaaabbabbaaabaabbabababbabbbbaaabaabbbbaaaaaaaaabbaaabbaababbaabbbabaaabaaaaababaabaaaabbabbbaabbbbbbabbbbbbbbaaabbbbabbabbbaaaaabababbbbaababaaabbababaababaaaaaaabbabaababaaabbbbabbbbbbaaababbaaaaabbabababaaaababbbaaaaaaaaababbbbbaabbbababbbaaaabaaabaabbabbaabababbaabbaababbaaaabbaaabbbbaa...
output:
*abbbabaa*
result:
ok correct
Test #64:
score: 0
Accepted
time: 235ms
memory: 10972kb
input:
baaabaaabbabbabbbbbbbaababbaaaaababbabababbbaaaaaabbabbbbbaabababbbbbbabaaaaaabbbaaabababbaaaabababaabbbabaabaabbbbabbaaaaabbaabbbababbaababbbabbaabbaaaaaabbbababbbaabababaababaabaabbabbbaaababbbbaabbabbbaaaabbabbbabbaaaabbbaaabbaabbbbbbbbaabbbbbaabbaaababaaabbabbbabbbbaabbbbabbababbbaaaabbaabaabbba...
output:
baaabaaa*
result:
ok correct
Test #65:
score: 0
Accepted
time: 161ms
memory: 10960kb
input:
bbbbbbbbabaaaabbababbabaaaaaabbabbabaaaabbbbbababbabbaabaaaaabaaaaaaabbaabbbabbabaaabbaaabaaaaaabaabaababababababbbbaabbbbaaabbbbaaabbbabbabbbbbbaabbbbbbabaabbaaaababbaabbabbbbbabbbaabaabbbabbabbaaabbbabaaabaaabaabbbabbaaaabbbbbbaaaabbabbabbaabaaaabbbbababbaababbbbbbabbaababbbaaabbabaaaaabaaaaaabaaa...
output:
*baaaaabb*
result:
ok correct
Test #66:
score: 0
Accepted
time: 175ms
memory: 10976kb
input:
babababbbbbaabbababbabaababaabbaaaabbbaabaaabbbbbbaaabbabbbbaaaaaabaaaaabbaaaaababbbababbbbaaaaaaaaabbbbaaabbbbaaaaaabbababbbbbbaabababbaaaaabaaabbbaaababababbabbbbbaaabaaabaaaababbabbaabbbbaabaababbabbbbabbbabbbbabbabaaabbbbabaabaaabbabababbbabaabbaaabababbbaaaabbabaaaaaabababaabbabaaabaabbaaabbabb...
output:
*abaaabbab*
result:
ok correct
Test #67:
score: 0
Accepted
time: 155ms
memory: 11124kb
input:
baabbabaabababbabbabaaabbaaaabbbbaaabbabaabaaaaabbbbbbbbaaaabababababaababbaaabaaaaaababbabaaaababaaabbabaaaababbbabbabaaabbbaaabbbbaaaababaaaaabbaaaaaabbaabbbaaaabbbbbbbbbbbabbabbbbbbabaabaabbbaababaaabaaabbaabaabbbbabaabaabbabbbaaaaaabbaaaaaabbaabbbaaaaaaaabaabbabaaabbaabbabaaaaabbabbbabaaabbbabab...
output:
*babababb*
result:
ok correct
Test #68:
score: 0
Accepted
time: 161ms
memory: 10920kb
input:
bbbabaababaaaabbbabbaababababababbaabaaabbbabbbaabaaaababaaabaabbaaaabaabbbaaaaaaaaaaabbbbabaababaabaaabaaababaaababaabbababbabbaaabbbabbbabbbabbbaaabbbabaaabbaaaabbbbbbaaaaabbbbbabaaaabbababaabbabababaabaaababbbbbabababbaabbbbbabbbaabbaaaabbbbbbbaabaaaabaabbbbaabbaaaabaabbaababbaabbbbababaababaabbb...
output:
*baaabbbbba*
result:
ok correct
Test #69:
score: 0
Accepted
time: 168ms
memory: 11016kb
input:
baabbbaaabbbaaaabaabbaaabaaabbbaababbbabbbabbbbababaaabaabaaaaaaaaaaababbbaabbabbbbbbbaababbaabbbabbabbbbababbaabaabbabaabbaaaabaaaaabbaaaaaabbaabaabbabbabbababaaabaabbbbaaaaabaabbaaabaaaabababbbaabbbaaaaabaabbbbabaaababaaabbaabaabaaabaabbbabaaaaaabaaaaabbaaaaabbbbaabaaaaabbbaabaabbbaabbaaaaaaaabbba...
output:
*bbbabbaab*
result:
ok correct
Test #70:
score: 0
Accepted
time: 214ms
memory: 11044kb
input:
bbaaaabaaababbbabbaaaaabbbaabababaabbaaaabaabbbaabbbabbaabaabaabbbbabaabaabbbaabababaaaabaaaaaaabbaabababbaaabbbaaaabbbbbabbaaabaabbaaaabbbbabbaabaabbbaaabbaaaababbbbabbbaababbabbaaaababaabbbabaabbaaaaabaaabbbbbbaabaabbbababbabbbabbbbaaabbbaabaababbabababbbbbabbbaaababaababbbaaabbbbbbaababaabbaaabab...
output:
*abaabbbba*
result:
ok correct
Test #71:
score: 0
Accepted
time: 186ms
memory: 11124kb
input:
bbbaaabbaaaabbbaababbaababaaabbaabbbbaababbbabbaaaabaababaabababaaaabbabaaaaabbabbabaababbaabaaaabbbaababbbbabbbbbaababababaababaaabbababababbbbaaabaabbaababbabbaabbaaabaabaabbabaaabbbaababaaaaaababbaaabbbaababaaabbbbababbbbababaababbabababbabaaaabaaababaabababbbabbbbbbbbaabaaabbbaabaaabbbabbababbbb...
output:
*bbbababbb*
result:
ok correct
Test #72:
score: 0
Accepted
time: 170ms
memory: 10912kb
input:
bbbaababbbabaabaabbbababababbbbaaababaababbbbaaaaabababaabbaabbbbbabbbabbababaababaaabbbaabaaabbbbaaabbbabbabbbbaababbaaaaabbbabaaaabbbbabaaabbbbabbbbaaabbabaababbaabbbabaabababaaaaabababaaababbbabbbaaaaabbabbbbbabbbbaabbbbaaabbaaaabbbbbbabababbbbaaaababaaaabaaaaabbabababbbabbabbbabababaaabaaaaabbaa...
output:
*aaaabbaaa*
result:
ok correct
Test #73:
score: 0
Accepted
time: 172ms
memory: 11052kb
input:
cbabaaabaabbabacaacaaabcabcbcacaabbbcbbcbaaabcacacccbaccacbbcbbcabbcbbcaaabbcbbacbabcccaabcaababcbaabcbcacbcbbaacaabababaccbccacabaabccccacccacbacbcbacabccabcabcabcaacbaabaacaaaaccccccccaabaaccaacaabbacbcbaaacaccacabbcabbbaacbbbcabaccbcbcbabaaaacbabbacaaaacaacacabbcbbcaaabbbccaacbaaccccabccbabaabcbc...
output:
*abbaca*
result:
ok correct
Test #74:
score: 0
Accepted
time: 167ms
memory: 10916kb
input:
caacccccabcccccaabccbbcbacbbaaaaababbacbcaccabbbbcabcabccbccccbbbbbcbabaaaccccbaaccaaaccabcbcbcbaabcacbbcbbcabacabcccacbcaacccabaabbbcbcabccabaccbabbbbccaaaabaaaaabccccabbacabccbcabcaabbcbacbcbabcbcbaaaacbbaaccccbaabbbbbaabcaccbabccbbababbbaacbaaabbcbcbbbbcacabcaabbbccaabaacccccacaababcbabbccacaaaac...
output:
*cabbaa*
result:
ok correct
Test #75:
score: 0
Accepted
time: 159ms
memory: 11052kb
input:
cabbabaababbbabbbbbcabbaabcabbaacbcbbaabaacabbbbbcbcbcacbcbcbcacbcccaaccccaabaaabcabaabaaacbacccacbcaaaabcbbccaacababccbaaaacbaccabcabacabbbbccbacccabbbbbbaccabbcacabbbabcccbbcccbbabbccbcccaaabcabaabcccacaaaacaabbbcacccbcbbccacbaacaaccbcccccbaabaabbaaaccbbababbbbacaaaccacaccccbcbaaccaccbcbaacccbcacc...
output:
*acacb*
result:
ok correct
Test #76:
score: 0
Accepted
time: 165ms
memory: 11032kb
input:
aaaccbbcbcccaabccbacbaacbbccccaacbcbacbaaacbccbcbbcaccbacbcabbcabcaaccaccbbbabcbccabaaabaacabaccbcacaaaabcacbabbbcbaababcbcbcacbccbbcbacbbaccaaabaaaaaacababbcccbcabccbabcbbcbbaccabacaaabacabbbacacccaabccbcbbaaacbabbbcbbbbbacbaacaccabbabcbbbbbabccbbbbccacaaaaacbabaccabababaccacabbaacaacabbcbacbbbcabc...
output:
*cbbcab*
result:
ok correct
Test #77:
score: 0
Accepted
time: 162ms
memory: 10976kb
input:
bbccabbaaacaabccbbcabaabacacccbcbcacacbbabcaabbcbbbabacbbccbcbbacbbbccbbbaaaacbababbbbacbabbcccaaacaacaaabababbacabccacbabccacaabbbbcbcacbcaaabaabbabccbccbacbbcccaabababbbcbccccbbaacaacbababcaaacbbcabaaacbabcccbbbccbcccaaaaacabcaaaaaccaaabacbbcbcbababcbabbaabaabbabbabaabbabcaaacabcbbcbacbbcbacababcc...
output:
*cbccbc*
result:
ok correct
Test #78:
score: 0
Accepted
time: 169ms
memory: 10924kb
input:
lpttdhethqqjsrubvpdqeovuoplraehsetbotseeccifeigbhnvuevaebtbdsprgjoqcsffsfhfarsinftmposbqrdckmvnmjaecapcpsmrpcdaifaonvcqocctnnsblmrrcdqkoielilvjfcehjulaiiqqnjqvfggtkifvmgdvaieejlhfmfqsbaoancnqkgsclbbonggedmsiqrsuaehifupvhdrkgnutviqaptfndvbueomvvfaddagpqcfqdveaelalfinvdpdrlrumcsdoqhikjafqlhnhraniugohn...
output:
*sd*
result:
ok correct
Test #79:
score: 0
Accepted
time: 163ms
memory: 11128kb
input:
oritciiecdskatgrbgfktnwtcnkbgokhvtjdnsvskfhsuhdaliempcinwhgqhltimclbvorwgpjdsdfspldiurhkrlwtsuohjpcsfhpohatgpqnkaonhftitshupwoklnhvgjamhdfhkbjtomjkbfqbmffgmtgspfnumgdfbuglicskmlcefeuaqmlobsgtgkgmhuieshisrbgifurucoqivthhogdjskdfcjpwiieernhmcdrgsrlapsiucqjuehucqlrimhwumjvqiwfovovegttgqovabdqbodfqjcqdm...
output:
*vwo*
result:
ok correct
Test #80:
score: 0
Accepted
time: 162ms
memory: 11056kb
input:
updqlfbekkkdanokirpipkpsnwgngbpeurgklrbjiqajpbkeifvouucscddhairrabwessumieqpcthmvitvcwrabaterhfgfrwsuenxutntexhofpktvssjabsaksxwfhcbmmjhkhujktxwevrtixhbkcnhswkwwfxmhgfpnoitqqtpuvjkxhfldhhglwukdrqxanlfbsvpbfhpcnitioivhufabxxwqvkofwadcbaislpqtprkfrmrcvkjsnbnjpigheagnvulxrxgkjbtdmvujwcoqtmedcgcfuhsemos...
output:
*asm*
result:
ok correct
Test #81:
score: 0
Accepted
time: 168ms
memory: 11132kb
input:
qvmxredpqwnnijojyaooivkyhlakakxcknvuyyokyjmxdcrdcfxjtscayyakvcuxproyhhkcutvvdebbmqgfyvfkmhcimudfhnmqtjkjgwxmnepdmmsreotldpunphyemtgbuigpstrvwyxspenfsnsqvyqrtfassiulcmctdpjlytqkiyypagstoqwmdocvofywwpmotkeakcrlmtbwwbfqcvjnkdtbmgwkrvnawfaqngijytjryufyftrreslvjacrxwcfpskperradbpsqcoanajpwpxinunejseqdanf...
output:
*ckx*
result:
ok correct
Test #82:
score: 0
Accepted
time: 158ms
memory: 10980kb
input:
brleofcmbhtgyjhaoqqmdtzyyakmidnbqnsisunzorvahityskealvozpjrlcyuzsnezbueqnbcjsxjobuiqjiebzeeayxtwxqowjiubyfvytrazgatudhfshhuunqkgmpoxjueebvaitdincjxthsqcvqwsjxldttmvdcxxksygghpfvwhrahtfxqxtljbfnuujoamdqicjkrwlneudalkuuyibrhmlbyjmbusehslqlfbmihvxarkaxkpxlrovmaurmwuwcxzgdsjylduqdpzgqvgzyhkieryzjgafsxry...
output:
*lm*
result:
ok correct
Test #83:
score: -100
Wrong Answer
time: 37ms
memory: 7212kb
input:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
*
result:
wrong answer pattern matches the second string