QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#440570#7262. String ModificationI_Love_Sonechka#AC ✓167ms9740kbC++171.4kb2024-06-13 20:45:482024-06-13 20:45:49

Judging History

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

  • [2024-06-13 20:45:49]
  • 评测
  • 测评结果:AC
  • 用时:167ms
  • 内存:9740kb
  • [2024-06-13 20:45:48]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

// c++ short types
#define vt vector
//typedef long long ll;
typedef long double ld;

void whattime() { cout << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl; }
const int inf = 1e9;
const int mod = 998244353;
bool debug = false;
const ld eps = 1e-9;

mt19937_64 rng((unsigned int) chrono::steady_clock::now().time_since_epoch().count());

const int maxn = 5010;
bitset<maxn*maxn*2> dp;

void solve() {
	dp.set(0);
	string s, t; cin >> s >> t;
	int n = int(s.size()), m = int(t.size());
	s = 'x' + s;
	t = 'x' + t;
	auto get_id = [&](int x, int y, int k) {
		return k * maxn * maxn + x * maxn + y;
	};
//	vt<vt<vt<bool>>> dp(n+2, vt<vt<bool>>(m+2, vt<bool>(2, false)));
	dp[get_id(1,1,0)] = s[1] == t[1];
	for(int i = 1; i <= n; ++i) {
		for(int j = 1; j <= m; ++j) {
			for(int k = 0; k < 2; ++k) {
				dp[get_id(i+1,j+1,0)] = dp[get_id(i+1,j+1,0)] || (dp[get_id(i, j, k)] && s[i+1] == t[j+1]);
				dp[get_id(i,j+1,1)] = dp[get_id(i,j+1,1)] || dp[get_id(i,j,k)] && (k==1 || s[i] != t[j+1]);
			}
		}
	}
	cout << (dp[get_id(n,m,0)] || dp[get_id(n,m,1)] ? "Yes" : "No") << "\n";
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(nullptr);
	int tt = 1;
	if(debug) {
		tt = 1e5;
	} else {
//		cin >> tt;
	}
	for(int t = 0; t < tt; ++t) {
		solve();
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3688kb

input:

snuke
snukent

output:

Yes

result:

ok answer is YES

Test #2:

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

input:

snuke
ssnuke

output:

No

result:

ok answer is NO

Test #3:

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

input:

babaaaabaabbabbbbaaabaabbbbbbaaaababababbbbaabbaaaababababaaabaababbaaabbbbaabbbbbbbabaaabbaaaaabbbbabbabaabbbaaabaababbbabbaababbaaaababbaabbbaabbbababbbb
baabbaababaaabababababbabbaabbbabbbbaaaabbabaababbababbaabbbaababaabbbabbbaabaabbababaababbaaabbaaababbaaaabbababababbbaaabbababababbbaaabbbabab...

output:

Yes

result:

ok answer is YES

Test #4:

score: 0
Accepted
time: 1ms
memory: 3864kb

input:

babbbaabbababaababaabaaaabaaabbbbabaabaaabaaaabaabbabbbababaababaaabbbaaabbbbaabbbaababbbbaaababaaabaaaaaaabaabbbbaaaabbabbbaabbaaaabbbbabbbbaaaabaaabbbaaa
bbbaabaabbbababbbbabbabbababaaaabbabbaababababbabbaababbaaabaaaabbaaababaabaabaaabbbbabaabbabbaaaabaaabaaaaabbaaabaabbaabaaabbbabbbbbaaabaaaabbb...

output:

No

result:

ok answer is NO

Test #5:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

aabbbabbbaabbbaabbabaababbbabbbbabbaaababbabbaaabababaabaaabbbaaaabbaaaabbaaababaababbbbbbbaaaababaaabbaabbbaababbabbaaabaaababbbaabbbabaabbaaababbaaabaabb
abaaababbabbbabbaabaabbbaabaaaababbabbabbbbbabbaaaaaabaabbbbbbbbabbbbbabbbbbbbbabaaaabaababbbabbbbababaababbaabbaabbabaaabaabaabaabbabbaaabbabaa...

output:

Yes

result:

ok answer is YES

Test #6:

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

input:

abababbaababaaaababbaaaaabbbbbbbbbbabababbbbbbbabbaabbabaabaaaabbbaababbbbabaababbabbabbbaaabbaaababbaaaaababbbaaaabaabaaaabaabbbbbaaaaaaaabaaababaabbbaaaa
abaaababababaababbababbaabaababaaabababaaababbbaaabaaaabbaababababaaaabababababbabbabbababababbbababaabbbabaabababbabbabbababababababababbabaabb...

output:

Yes

result:

ok answer is YES

Test #7:

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

input:

aabbababababbbaaaaaabbaababbbbaaaaabaabaabaabbbabaaabaabaababbbabababbababababbbbabaaabaabbabaabbababbaaaabbaaaaabaabaabbbbaaabbbbaaaabababbaaaababbbbaaaba
aaaabbaabbbbbaaabbaabaabbababbabbaabaaabbbababbbbbaaaaabaaabbbaaaabbbaaababaabbabaabbaaaabbbbbbabaababbaabbbababaabbbbbababbbbaaabbbbaabaaabaaba...

output:

No

result:

ok answer is NO

Test #8:

score: 0
Accepted
time: 1ms
memory: 3876kb

input:

aabababbaaaaabaabaabbabbabbaabbaabaaabbaaabaaabbbbbaaaabaabbaaaabbaabaaaaabaabbabababbbabababaabbaabbbbabbabbababaaaabaaababbaaaababbababbbabbabababbabbaaa
abbaabbaababbbabbaaabaaababbabbbbababbaabbbbabaaabbabaababbaabbaaaabbaaabaababaabbaabbbbaaabbbbabaabaaaaaaaaabbaaaaabbbaaababbbbbbabbabbaabbbbba...

output:

Yes

result:

ok answer is YES

Test #9:

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

input:

bbbaaaaaaaabaabbabaabaaabbabbbbabbababbbbbaaabaaaaababbbaaaababbbabbababbabbbbabbbaabbaabbabbaabbabababaaabbaaabababaaabaaabababababbbaaababbbbaaaabbabbbba
bababbbabbaabbaababaabbabababbaabaaaabbbaabbaaabbabbaababbaabaaabaabaaabbbaabbabbabbababbababbabbabaaababababbaabaabbababbababababaabaabbabababa...

output:

Yes

result:

ok answer is YES

Test #10:

score: 0
Accepted
time: 1ms
memory: 3940kb

input:

abaaaaaaabbaabbbbbababbbbbaabababbbaaababbbaaaaabbbaabaabababbaababbabbabbaababbbbbabbbabaaabbbabababbaaaaaaaabbaaababaabbaaaabababababaaaaababbabaabbaabab
abaabaaaabbaaaaabbbabaaabababbbaabaaaaabbbbabbbbabaaaabbbbaaabaabbbabbbbbbbbabbbbbbababbbaabbabaaabbbaaaaaababbabaaabbbabbabbbabaaabbabbbaaaaabb...

output:

Yes

result:

ok answer is YES

Test #11:

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

input:

ababaaaaaabbaabbbaaabbbaaaabaaabbaaabbaabaabbbbbbbbbabaabbaaaaaabbbbabbbabbbbabbbbababaaaabaaabbaabbbaabbaababbababbaabaaabbaaaaabbabbbbabbaaaababababbbabb
abbababaaabaaaabaabaaaabbaabaaababababaaababababbbbaaabababaaaabbbbbbbbbbbbabbababbbbaaabababbbbbbaaaabababbabbbaabbbabbbabbbbbbbbbbabaabaabaaab...

output:

Yes

result:

ok answer is YES

Test #12:

score: 0
Accepted
time: 62ms
memory: 5804kb

input:

bbbbaaaaaababababbabaabbaababbabbbababbabaabbabbabbaabbbaabbbaababbaaabaabbbbabbaabbbbbababababbbbbbaaaaabbbbabbbabaabbaaababababbabbbbabbabbbabaaabaaabaabaaabaaaaaaabbaabbbbabaababababaabbabababbbbabaaaaabbabababbbaaabaabbabaaaaaabbbabaaabbbbbbaabbbbababaabababaabaabaaabbabaaaababbabbbaabbbaabababa...

output:

Yes

result:

ok answer is YES

Test #13:

score: 0
Accepted
time: 69ms
memory: 5748kb

input:

aaaaabbbbaaaabbabbbababbaaaabbabbbbbbaaabaabbabbaaaaaaabababbabbababbaabbbbbabaaabaababbbbababbaaabbbbbbabaabbbbaaabbbbaabbbbaabbbbaabbababbaaaaaabaababaabaabaabababbbabbabbbbbbabbbaabbaabbbaaababbaaabaaaaababaaababbaabababbbaaabaababbabbbbaabbaaabbababbbbbbbbbbbbbaaabaabbbaaababaaabbbabbabaaaababab...

output:

Yes

result:

ok answer is YES

Test #14:

score: 0
Accepted
time: 44ms
memory: 5668kb

input:

babababaaaabbaabbbbababababbbabbabaabbbaaaabbaaaaaaababbbaabbbbbaaaabaababbaaabbbabbabaaabaabbabaabbbbabaabbaaabbaaababaaaaaabababbbabaaaabbabbaabbbbabbbabbabbaaababbabbaaabbbbabbaabababaabbaabbbbbbabaaaabaabaabbabbbabbaaaabbabaabbababaabbabbbaabbababaabbabbbbabababababaabbbbabaaabaababaaababbbbabab...

output:

No

result:

ok answer is NO

Test #15:

score: 0
Accepted
time: 65ms
memory: 5748kb

input:

abbbbabbaaaabbbbabaabaaaababbaaabbbaaabbabbbaaabbbabbaaaaabaabbbaabbaabaabbabaaabaababaabaabbaaaabbbbabbabababbabbababababaaabaabbaaaabaaababaabaaaabaaaabbbbabbbabbabbbaaabaaaabbbabbaabbbbababaaaabbbbabbabbbabbbbbbaababaaaabbabbbbabbbababbbbabaaaabbaaababbbbaababbbbbbabbabbaaaabbabaaabbaabbbaaabbaaa...

output:

Yes

result:

ok answer is YES

Test #16:

score: 0
Accepted
time: 64ms
memory: 5988kb

input:

babaaabbabaaabbaaabababbbabaaabbaaababbbaaababbaabbbabbbbbabbbabbbabbbbabaaaaaaabaababbaaabababaaaaabbbbbbbaaaaaaaabbababbabaaaaaabbbbbbaabaaabaaabababababbbbbaabbbabaabaaaabbbaaabbabbabbabbbabbaaabbbbbbaabbbbaaaaaabbaababbaaabaabbbababaaababbaaaaabaaaaaababaaabbaabaabaaababbbaabababaabaabbaabaaaaab...

output:

Yes

result:

ok answer is YES

Test #17:

score: 0
Accepted
time: 40ms
memory: 5812kb

input:

babaaaaaabbaabaaabaaabbabbbbbbbababbaaababababbbaabaababaabbbabbabababbabbbbbbaaabbabbabababbbabbbababaaaabbbaaabbaaabbbbabaaabaabaaaaabaaabbabbbaaaaaaabaababbbbabaabbabaabbaabbaaabaaabbbabbabbaababaaababaaabaabbbabbaaababaaabbababbbbbbbabaabbbbbbaabbbababbbaabaabaabbbababbababbaaaaabbbabbabbaaaabaa...

output:

No

result:

ok answer is NO

Test #18:

score: 0
Accepted
time: 65ms
memory: 6000kb

input:

abaaabbaabbbaabbbbbbbabbabaabababaaaabaabbaaabbabaaabaabaaaaabaaabbabbaaabaaaabaaabababbaabaabbbbbbabbababaaababbaaaaaaaaababaaaaabbbbbabbbbaaababbaaabaaabaabbabaababbbabbbaababbaaababaaaaabbbaaababaaabbaaaabbabbbbaaababbaabbbaaabbbbbabaaabbbbababbaabbbabbbbaaaababaabbababbbbabaabbaababaababababbaba...

output:

Yes

result:

ok answer is YES

Test #19:

score: 0
Accepted
time: 64ms
memory: 5836kb

input:

babbbaabbbbabbabaaaabbbababababbabbaaaabaabaaaabbbabbbaaabbaababaaaabbaabbabbbababbbaaababbbaaabaaaaaaaaababaabbabaaaabbbaababaaaabbbaaaaaababbbaaaaabaaabaaabbaaabbbbbbbaaaaaabaabababbabbbbbbbaababbaaaaaababaaabbbaabbaaaabaaababaabbabababbbbabbabaaababaaaaababbbaabbaaaaaaaaababaabbbaaaabbbbabbaabaaa...

output:

Yes

result:

ok answer is YES

Test #20:

score: 0
Accepted
time: 44ms
memory: 5772kb

input:

aabbbabbbabababbabbbbabaabbbabbabbbabaaabbaababbabaabababbaaaabbabaabababbbbabaabbbbbbbaaaabbbbababababbaaababaabaaabbabbbababababaababaaaabbbabaabbbbababaabbaaabbaaabababbbababbaababbaaaabaabbaabbabbababbbbababbaabbbbbabbbaaababaababbbaabbaabbabbbbbaabbbbbaabbbbbbaababbbabbaaaabbababbababaaababbbbb...

output:

No

result:

ok answer is NO

Test #21:

score: 0
Accepted
time: 8ms
memory: 5084kb

input:

rjpasogyjvbvvoktzfxbubmoycqgngssowfkszviaqvjmcephxfbuowkjniqeqadlqjotalrnpfzricoivfnuqxkcccnxvowexhhosrhubzdyhxedxjjnatmrbenwnuomtdvrxgnhuopydydddvxwvzjpmktjlrdedkpeumyesptcmvgedxqnnsohafwlorhcvhrtjguqoqfegkgebcsgouhbxfksqisyzchowltjdxzwqkbnrsmabzalehtebpxxnlozehchvrglxtxcczzubwnafykgmpxkjdjdoazruxs...

output:

Yes

result:

ok answer is YES

Test #22:

score: 0
Accepted
time: 8ms
memory: 4800kb

input:

oddoybpchccvijeqmtjyipytwfnebyntyvtpvejxxowwkbqlpevtzchzdxorfoafemqvyjwzjqlapflaacnjtwaambhacyhbeviigsrpxifmdtxapdpbrzdmjtmqiwzzppkydeegxtmcxlnnekmwfkimwrzppmptvgyexnziaoaaypuaufkwtglfzyxoaedyleixooeexjkpxtaznmarglrfpcvlegrpwijblhpkkejkyyjtkplsxteisungdqayubuwzmcuhpvjftczzknoglujdvnlutejdhokuzmmtijg...

output:

Yes

result:

ok answer is YES

Test #23:

score: 0
Accepted
time: 3ms
memory: 4784kb

input:

xuydwbcmtlayumrmsiuueutqhonbkvywecdorvgsqobcovenbvbdaodzcvsmryttmwgpujzonvsdogpdykordfxuotbbxziikuyihjisixjodjwoefwwpzebbhotjxdtsulbunyqmagqtyavwmafxspumnqnpswyweorymfnrordzzynmidfzdflsvirdwyxkevlwovfqmrpzntuuwqkjrepvasnlehkcjqdmfxledwcpauuputevamycxgcrpmyizidyqvybvjntpagaaakzgvmblbirjaljbwshipixayj...

output:

No

result:

ok answer is NO

Test #24:

score: 0
Accepted
time: 4ms
memory: 4852kb

input:

unsxzpjewyirblkzgusgtkgmtyyyuposeiwgthbqhsmijougetqlujltwlcnmfnwaaqihofkdlebctbkteneipincvhwlmyxdqioflenlcwqrbtmemvyjondlxnfvjbpxsiwqtlvmwmvhymqbcnralxaadvghigaiowgbggrqidmqyesweqqwpdmqvtnmoiqhhmtyooyscvxkuitniqlfekwtkhfyawwxsaankxahknwulvymdwekodqjtprzdkxcerbndlvdragvpnbvvclfhvczijtkqatzjxyfzfeyzoh...

output:

Yes

result:

ok answer is YES

Test #25:

score: 0
Accepted
time: 8ms
memory: 4824kb

input:

wsqeywynfwqjynejgdommykqnebbszcifsenlkgtjlkhodrshlsdmwhfuhvktijpxdebjvygzyvociioivrprknkrpnfuvydfbktnwupiuhlpqbwaveixdaggiqzhjjurcdqqxudkjjdhljaeivgtyksprqvqqikdlsmocvohhykbcrwcwykwykivdnvyskpxlntrpxufdkedcvhmlfriirwemktcmrgtmwqeeztbwrjjnbatgakhnlxsxeyihoafubkgdoyyozayinbaothgadiqplsgpuvurgnxxqqhpfs...

output:

Yes

result:

ok answer is YES

Test #26:

score: 0
Accepted
time: 3ms
memory: 4840kb

input:

noacdjquzfvdhpmishqcduvxdxegpgyunnpshsfjqctcrkfwviuoxslpznxqksbhzailaghqdoyrvprwoeeipxdyjjmrtdqbxjdgqajrahluokuhtubdrbhivzqvwgbftvkcsknivjqxrnxvyjgwgsjshkbljtxhdumzhqmwnlpqkkxdcxxfpplibqesikbsdlbrhwcevmfnwvmuhcuybxtmuqdmrnxlodsbwmlkucemteysmigwymiqrsccwwfowyfnxaewwzxmzaldcamoicokqussudabzymdxlsvvyjw...

output:

No

result:

ok answer is NO

Test #27:

score: 0
Accepted
time: 5ms
memory: 4836kb

input:

hhetrzeyrtvinztqqszhgppllyzzuyrfvtcziiunmtzyjmjcsoyqlifcjpepfjvwqsdxghogskyvqxihkxxskkssggmunjjxzfmfsbmxmifkbvuclrkjgivkkmdifemfifrqudoqtiidvwwcllyyabriduitthofdmcgizqwxxmueiezobqnqbkkweyettbnpcycsdkwkxedliapnrkxylohcsvugcsnskxmssrexpjqbnhgdpsxprgptzndljychdmaawhcnpwxavunwpdayfexizgccwdwrnbnvcixibyn...

output:

Yes

result:

ok answer is YES

Test #28:

score: 0
Accepted
time: 8ms
memory: 4844kb

input:

ztjxpjjnbldssbglkmncptynicwspotxrgmertzalkiattjwbowxivnvcrdrbaygwuibazqzlfihrlgtqdugbzwocxlwjsgpzuyzdviczkdieaijgiagbjajyrwglayaatpfqglrdmebylfzvrstubbqxskelfkodpznbbicreevgjarccqpfmhxsgakdtbtymhxzaoxyvkidvljwutwwwebrtlsbhujdhumqrfcwlqkdgkghvwhxdjtkodvrqwbqhonjztumwuaipygncfnfohodtrlceqqagxqvinbuobz...

output:

Yes

result:

ok answer is YES

Test #29:

score: 0
Accepted
time: 7ms
memory: 5036kb

input:

dgppwjunfsuzqlqdevvzbiapopczqikjlfsimjwcytoblxewkxmkjjvxqyulszzgpnlrwoycbnpnqjineztlgafzzuounxxazhtyxmapburkglfntgardqklapjberdyrcilkfoxcvrknybocdvyzifjgphbadmvwgzcoutpqlcwksjomlwavjdprruktxchcvnowhktegiveylocgtmaasvtvpupelkssqtwumyfopntrrlniwfbfezsrxwhjgghosndrqpbymqrljdcphhatxypdyrwnmulhddnebbuvpe...

output:

No

result:

ok answer is NO

Test #30:

score: 0
Accepted
time: 89ms
memory: 7436kb

input:

lyajbptvgbpzebanuelrgazkpxwfmybqxgntcsxvynmcfcvztctuulwbxosffwpxclbofshgmormuehvvtmxvrvqcjbxtgpshsbtiuudkcmlniecabenxbgcrhqatltdgxhodxrkdxxnczpbqqzejhjfdehwcqfvjelbdxobnmkrptdmskqjhtusgwabyptmiukhbxxhtwxyqggznwylgeljmpyupuvdrfvpghtmebcmornzphdkffcstaeiafmuuexdftflizyglkydejpitcwuquybogrzumcpdjprhvdy...

output:

Yes

result:

ok answer is YES

Test #31:

score: 0
Accepted
time: 81ms
memory: 7524kb

input:

cjyzfwkcwdowuxwvcrrqblotqfnboaoxxujcpoopmopiihzinolvtyvifofgfvlizjtsklvwzoghnescciazmtqbnmuslsvxslpsxxmtaoozgmpryhywurxrgjhcujkwegomcubegbhsulchhwqcfetodgxjpmtgwimcinazhdevdvkbfctjdadrmuucdsdnhnmnxxydbeqhajqshlbmrsemjvsneeapjquczmnupbhizeyyzxwiqnetllyqivmfjqgzfzixjhzjizljyrhrmtntnenkiqwwacxwgbwxxoim...

output:

Yes

result:

ok answer is YES

Test #32:

score: 0
Accepted
time: 83ms
memory: 7600kb

input:

kzyqvyzoguyulotbhxbpioedgvksklujedcvcnimppsfwqqxqrdccrobjmkucibfepizokistsqrhlgeqyluvvackmowslhenpumonesmxumrcnleghjzuilgtkdibdylbstvovfsaglilxpxjdhfccmrlqlgeauqerdzsnswaqtmgxkdwtlhqnhzpbmhnekffqmijnhflqwqkhdmoskthtstcqljauwfmllbcsintjaxswmnpwowbwnawdhrprwgzmyqdmppvrgvypbsyqlxrnykrwwforejdedappaugse...

output:

No

result:

ok answer is NO

Test #33:

score: 0
Accepted
time: 93ms
memory: 7316kb

input:

zbddmwisiiyazyosvavyaphjuekofzzdbbwjckkbhzbubuuadrusxhpguruynagrnannpjbzdcqaljsljefcwqlunjgeyfsksoqthibhqaiynzwumeukhsghpbkoeljcpnpnxapgbonwhtwjwljyagikwmecglhgeiljqfnydsshuonixnerdurhzirabxrieevvgrtmyuzkrsbzuhibeyizdsofnnyadrdvbdbihjobyajszyjywasxgaltsucnlybueanuivemasyfgoklhibfiukjssugrwqczofgbhee...

output:

Yes

result:

ok answer is YES

Test #34:

score: 0
Accepted
time: 85ms
memory: 7432kb

input:

jtlhlcvibpsqskueotsbibjudctrdmyqvyhjkvjgvxhomdwagawiefcskhhzbrksusaurhwuomwbnmmaebudrpofmlyzvzqxstlkfizasuxjrfmeygtpuhjqjhwvedipdhmwgkppavarxxnubezpwjhtimuhgtazortfmgmwbjlojbmzavfpttzurwrljprkueyfmwgrxdaqzdtwbsevbxojyrhnidxixuvtdumdlcxlowueoiemstqoceqofhfviywglwugyqhsnqijrhjzbmebmkryddjebooyiwucyauy...

output:

Yes

result:

ok answer is YES

Test #35:

score: 0
Accepted
time: 84ms
memory: 7372kb

input:

jrxwaykcasdaoerevupskjgbhavpcfxiebaqlujrdhgjjsykslsnsjiualfhlygvajmjafwdecyxtcrzfvmqltljqjatkexrmhnqedrixzzcwohhacqokjacqsunwqevtelrbacnauqgxvlgntztzyvwrkhtxziwbalcxfbwruceuwdbczvqaimtjsibhztqcsqyhrenobdvhsxcyaxptasscvznwkvbryojoobgeiojbrgnhwckaogazxaplvxkfydoawvdditybpagueysjwyxlstyjzmamwwotquuclil...

output:

No

result:

ok answer is NO

Test #36:

score: 0
Accepted
time: 81ms
memory: 7432kb

input:

pbtthusbywagdrlnalykzfecogjgzeuoqwyddktqqtyysifulfygjjbutncmqmjghlwfjdroftzkrcgewawfkgackqupjovojzmgfbzgoqejfhrrxqmymimdunrkctlmtbkochbqqvyfvudqrtloalcpegyjkfpsnqqtckhgzzfgthbnassvhccjijqgvftehfzagurdjurwhrvarwqxdietywtckppcbefihuhombdamhtizpjetfzpwifibjhuhlvltpzbbcyvjsookshjhjoncxlamyhplfedmhkwplkp...

output:

Yes

result:

ok answer is YES

Test #37:

score: 0
Accepted
time: 75ms
memory: 7300kb

input:

jribphgsooltytdnjnegcemenjrodhypxhsbhtnhfswoxalbrrbifeuurfccapupydeuohlrhfkgvvpkvwrfjizmssuivodlqxmqdlaixuzljvreazizwnldcmgfqvfvjoogctrjwwlnotgtaihaylkhbkerzlcmchrpjpzsoxwlgweopjsttykziirwiutygnanvskbfrximfrnyrsgopoxossjmghqzvgozeiggzdmunqbutatajpflqllqcnymccxrdelvakmqykllnjwzcbcbmgiwxlamfxrjubepybe...

output:

No

result:

ok answer is NO

Test #38:

score: 0
Accepted
time: 79ms
memory: 7376kb

input:

tisnocqgkcpjhfnedirtxwgmzggbjanvclpvkoivkofrtczndpovcizfbiztugjsjnddxnzkpqjsdmasgjjuwvzhzkznkqeexvxxcpcwnowqitqljymspnzygaznuvbjaqsbnxuxhmkmimzkmpnxacttacpeshzerguwjesjglcivushpsqievtvhcbbqngdytzwdlopojspavyygnsuvzqecmlgmqrqbowzkiielycasljhtgfjdgbrantdeiilygeydfvyxhmetphvalanwmoetvtxmvjqvxvwbhrhxjku...

output:

No

result:

ok answer is NO

Test #39:

score: 0
Accepted
time: 2ms
memory: 3672kb

input:

effcibjafjjaehakiaihehacihihdkdhffdjkiijjkicdeaggddhbckkbkkiccfifdbiebfbkceejieghhagfahaghfdejciahgjhhka
eibfgchdaacdffcehbejhhcidfkdkakfikiegkjhidaedhbkafkecdeadjgjaijjdfcfabfhaehfhadbcegcahedakfiekafbdefjjkaejaieacbckagfdefiddgaidfijjjeadfchgakceddjhadbfbedhjkibajjegkjfdjaigkekgfikjbkikhkgdeahgjkb...

output:

Yes

result:

ok answer is YES

Test #40:

score: 0
Accepted
time: 2ms
memory: 3664kb

input:

faafcjaadjbefhhiakhdbfkccbcickkjdekbajahgakigiiddijabfkgjijbcgdgibefbcghgcjkfikebekbicegjigcegjfafgchbhf
fbdjfdgiikfbkfhdjcaajgagjcbifegebebcefhhggcabjkbdakffkffdbijkbhbafehkhcjjgcjacdebecjajjffiafajfjagjihijigdhkakkahdkckcdkkgbcgkddjigikcdfijiikgbddhebghidafjbjdchchgjckbhadkajaeggidgedjkiikbdeaikjj...

output:

Yes

result:

ok answer is YES

Test #41:

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

input:

ibiddadkhgcgkckeiihbicjhjaihaafkiddbgdgjkafcfcdbcbcbejekicifbdkhkbgdjhccchiafgihjacdajgifegckjakjhaiibde
ghiecfeikdcabbgfhjecagekibddcdeakfdbeehhdedicdfkgdfebiadkfkahahkkfbekchhaedfbbkjbffjigdaeahakhbgjhhbfajcjfgacfdjgjjgekjcgiibkhieckiehdkcihfgcgidgdbkegaddakgejbkjfgabajidabceefheigdjdbeikgagjkdfff...

output:

No

result:

ok answer is NO

Test #42:

score: 0
Accepted
time: 2ms
memory: 3748kb

input:

kgjdahdecficbcdejjaajckbadacibdkggbbjiecbgedbcjbegfjbjbabaghcdbfibaiakakkdibffehedaggbkgcfedbddjgjfjjcee
kfiidbefeiegbhjdggkgebejbjhddkgakgfkghjdcehcifgdbgddggjekegcabdagbhdcgekdakjdkcbdegfaacfcgdehjdajikjhfgebgabhdaehidafeegaaedfhgeecgihahebahgajjafagkcjgfjbddjkbhdcejiegdgajeeeifdcecijkaejegidbbgbj...

output:

Yes

result:

ok answer is YES

Test #43:

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

input:

ffkeecbjcjhfjjcahiadceeickkibkddcbajekkckkghdfdiiffciahhdhjdhjfjfiddjggcfbahikjjcggaaeaijggikfffcaeijhgk
fejjhcckaeihijehbdjdbeadeeagehjkkeafedjafkfjihkehfkfdahgjeefeeeigfbedjjceahgahcjkabdgkihdicifhecbbkdchkdfhbkfbcejdkdhcbjjgjiabfhchkhghehefbfjkcdfjgdekkefgfhkhihgifkdjkigakjdbdfbhdbiiihchjeagiaiaa...

output:

Yes

result:

ok answer is YES

Test #44:

score: 0
Accepted
time: 2ms
memory: 3744kb

input:

cgdjkbghcgdggddbbjifahdkffkhafigfihbafkfffcdbffidjfiebfadgbjgahkikkdfjijggfgjfkgaebdfafacikgahjeakiddkhd
ihijakjiegcckjaeccgbadhgiiebihjjhjjibkgajjhebkiadkdekgijggcjfckghjcfccdjbkcjghefkedakecefbbadihgiecjjgicjgeahgfbgkjacehejebcaidiehfaggjhkbkcefhkeichehfghkfbffjahfgajhkcjfabfffiejgdidjecihdbkdebck...

output:

No

result:

ok answer is NO

Test #45:

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

input:

fhgcdjhcbfggcdgkjejkeedeaibjiafiggbfehkfeakckhghiaebabcgjdkggkkbfgehiehkgcfeggcaghjhfaeehfdjhbhahfebjbej
fajcfkjheiihgkkgdeeiffdgkiehageehabigedajkfgbhbigjibhcjchiabjfcdchcdjbfaecadechcgjcgadkajeieeeckdifbeadhggjibgedchhdajkgkjcifakceebahcgkfkaiibhegehckghkjkbdgehaafkkfefickadgcacbefckakfgjbhagddekh...

output:

Yes

result:

ok answer is YES

Test #46:

score: 0
Accepted
time: 2ms
memory: 3688kb

input:

kbcihkkciekhgfdbhiiddcfegejhkfghfeaebjjcjcgcjcchhccfijghdbkbckgfeikakghekeckiidajcjfchgebdikbbgkdehebagg
kgcickbagbfggdhckficagkhecgfheaghijfickjjgghcbhhbedakchcdjaejjbhebgkgaicdbgededfbihgjhakhgjdhfbdckbebfhhjgghgkahgjckddkieciahhiccigcijhfffacfbkkfddjcdidaajifjjedijjbdbdaebgacjaheiekfhkdedadjfhied...

output:

Yes

result:

ok answer is YES

Test #47:

score: 0
Accepted
time: 2ms
memory: 3756kb

input:

hhjgikdgghhcfadgfkgjcfhdgeecdbbfhbbbidchfbhbaiadbbgfgihcicfihhijjekijgdcdegdedjjiaabfhidadjhcihkeaajhika
fkajhfaidbcicdaibahibahggijaehkaeedkifcjddakhabgcckhfeejeihjdghdkehjedgikhckdjgiehbediaficceakdggkeagdjbhgkdjicjdheeajbhedchcakakjikajbecaibikibfhkiackjkfggfekciggfahbgjbdgidbgdhkfjcekbcbhkkkfaij...

output:

No

result:

ok answer is NO

Test #48:

score: 0
Accepted
time: 26ms
memory: 4708kb

input:

gbdfagadjgcagekhfdfffieelgcfhajbecjlaflebclcclkhlgfliljikdfjlaklfkkddbfelehgfdjlhgifdebkjjllgbhcfkhebkdibdhkeeijhhdbfgijgiikiddcialldiagllkijdkekfakhjcfdfahfgdaddcdaieeliidghgiebfedfilhdiajljhfhbiijhfdgjlkidbbcjillfckghlfahdcbcgalcckkffblgigeefgjbgbdjdaiiicldjdcdaehfledfikdddjfbhlikfceahgdlcblbibged...

output:

Yes

result:

ok answer is YES

Test #49:

score: 0
Accepted
time: 22ms
memory: 4716kb

input:

hfijbhbdfcibjhgcelldjjfkjbehblfgfkllcfjagbgdcblfdjeiceljccihjkihiakchficccljhflaiejgkibgfdhijggbjeacljhcbiafgbdbjaijfbbjegchjlhfgbfiglbhheigfdkdkghjedfikcdkhghffhcdeblfjedehdedjfjckkebhladjghijhbljclakkcaihjhafgblhglebibkhkhdeijchlbgbeejbgfkkdjhjdkafejcbbhbgldggkhbbbgfegblfhhljechgcbfjcfjbelfgfcadjg...

output:

Yes

result:

ok answer is YES

Test #50:

score: 0
Accepted
time: 25ms
memory: 4856kb

input:

hckkkldeeffkadjhlaiihcjdifcbgbdagckkfjjelclabadaiheahkhejfelbjjjalfclfljcaehgdjbdcgfheagfcfklkclbfaaebaaieblkhjaclbhcejbfbadjfchcfbdehiajfeibebaigkhleajaiejfikefcgeikdjfhdlhgjffbcajcllgfcfjcfgiadjkhcljhbhfchacccgjbggdhabjadbkhkifaehadkachfikefgbjlkalflldijaajaklfhgbdggfcjflidageladjcbafdicdkclbjibdc...

output:

No

result:

ok answer is NO

Test #51:

score: 0
Accepted
time: 27ms
memory: 4624kb

input:

ebgekgkiiabghddifgaeafbhgachhcjcbgcjlcccilbkfhlhkiciffkabiegigiekbllahfjcaeekalikheifldghbekbablcjghablkecccgdggbhjcbgdbiieaaakejgjhibbaebdkflabaijcagkfbelgdegkhacfhkkljkeddegfkhbcdaedibfgjkjjbliefikhiiacfkllhdlaegcchllllfafjaafclfahdlkkclgeffdbglkclibdfjkbceckeddalbhddckhddhjilaleajhdcfbjcjcgflfehj...

output:

Yes

result:

ok answer is YES

Test #52:

score: 0
Accepted
time: 22ms
memory: 4856kb

input:

ibfdadibjdecbdhhchghacbkabalhkjhakifcicliachlaleahabhjcfjacfdkbbaffddbdldgagblkkkafegblgjfhfcaliiecllahfffegceickgkedlhibghfidjagjlhkeldcjahgfklgcgjejhhebhlgdckaakkbkghdkecjadbkdfeabbdgfcklahifhfjhieakfcfaegiebdaahdflhihakkejilcaebgjficcfcfcejblbaeejgehcjcaciiifckehbjhlaldbgiffiaebdlkhladjfdaighbjci...

output:

Yes

result:

ok answer is YES

Test #53:

score: 0
Accepted
time: 23ms
memory: 4636kb

input:

glgbblegkijgkjhkbgchiakleigeaaalegggbgeljfhhjjiigkhhdebcdkgliihlakfflhabahbbikjhckaikjkkfjfikjkjadhbcbhajccecijhgaikldlacbifhidahbfglikigldilleaildgildhgkgiaaeefbgeeaibcfgclilhkdjdjehlgiejibagdgcahgjebebbhffddbdjagfebeekeiiahifelejeijljkekjadibhjhhlfebglcadhikjiebkkjcibklhdaffcadaihfeiebdegcdcdahfjf...

output:

No

result:

ok answer is NO

Test #54:

score: 0
Accepted
time: 26ms
memory: 4628kb

input:

klcdfbbcdckhbfkblkiaciehdaghcddhadjcggcfikfkleaglfdhfaelckblkeffcalhgfjbildlaecekfjahflddbcbakkacheecbicififefgeigkhidjjeghlgccecdfdfgkfkaaaehkejfkkehhajhldedkjfibddaeaieaicdbhcfcdeiifigdiejfaidafaeijfglkjliccgffhgaglhbgejdebklleaaekfbjgcjgfadijgejfalghkijclihaghdbfhfkjgeidaacccbhlihfifegbjahccaehek...

output:

Yes

result:

ok answer is YES

Test #55:

score: 0
Accepted
time: 27ms
memory: 4716kb

input:

hhfchcgaeagehfgaejcfighcefjabjgikfcebhfgkaehkaabcifkchidkjfgeigalkglkahjhebebefedfheckafdgibkffjihkeghjgekkcdkcehdadgfliladcillaicfgcecaifgbaebblcjebkkjkaedjgjilcefefghlbjbfaaegdbbdjalfjfcjdjbglfjkagajkilfbdeibaijibglljlijjiajcllebkdjfkiieffahbcjfkakailaedbbkkebdbljckkdblcifkgdbebllljalijkckeaejickl...

output:

Yes

result:

ok answer is YES

Test #56:

score: 0
Accepted
time: 23ms
memory: 4860kb

input:

dglkgkcjiaghgaffebkjheaidcfjbkadcjlhkifllgbadekcjcjlbekddhahaeijfjkjgihligeheagekfikgleicfcgcehildlffffijhkdicbdfgfkhgfbbblceageicfflhblbbkedkdeahgldlbfhgaaakibfkbdbgjljadgfkbghgckgifbeiadajbebhfdgkalhjkcdigfecjcailgelhdekkiacddkagcfdblhhgkjdehgajblaffgecfgbkffdabkglbhlbejbjbdjgbcjdlekblihlelljkhgei...

output:

No

result:

ok answer is NO

Test #57:

score: 0
Accepted
time: 167ms
memory: 9740kb

input:

babaababbbaaabbbbbaaababbabbbaabbbababbababbaaaaababaaabbaaabababbabbbabbaaabababbaabaaabbbaaaaababbaaaaaaababbbabbabaaabbabaababbabaaababbbaaabaabaabbabbbabbabbbbbbaababababbabbaabbabaaaaaaabaaabbbbbbaabbbababbabaabbabbbaaaaabbbbbabbbbabbbaabaabaaabaabaabbaabaaaaabbabaaabaaabbbabbaabbabaabaaabbaaba...

output:

Yes

result:

ok answer is YES

Test #58:

score: 0
Accepted
time: 146ms
memory: 9732kb

input:

odvmjqwmmkruizissumakqvldnuvfggbgxwmcgibhxubcpzhnftchhdnumbosnzizhoujpaowwrdcyuvovmigtychffbxpxlxzxeujvaljagehjujwvwdondqanbmgzholpfxkrfgsafqhtzudbmomjbtdbuwptmrqjwvxhkfbsoqafjfkwbjdiyxffmklnfkjqjifquymybrgqsoxapmkkmehxeaqiqjyukahovdihdpidqvkgwweyeeldkyahtqrdiirfzvfvjtlzuondtvtjbizrudfddzkaedbnmxtah...

output:

Yes

result:

ok answer is YES

Test #59:

score: 0
Accepted
time: 1ms
memory: 3696kb

input:

a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

No

result:

ok answer is NO

Test #60:

score: 0
Accepted
time: 137ms
memory: 9676kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

Yes

result:

ok answer is YES

Test #61:

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

input:

a
ab

output:

Yes

result:

ok answer is YES

Test #62:

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

input:

a
ab

output:

Yes

result:

ok answer is YES

Test #63:

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

input:

b
baa

output:

Yes

result:

ok answer is YES

Test #64:

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

input:

a
aab

output:

No

result:

ok answer is NO

Test #65:

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

input:

b
baab

output:

Yes

result:

ok answer is YES

Test #66:

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

input:

b
bbbb

output:

No

result:

ok answer is NO

Test #67:

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

input:

b
babaa

output:

Yes

result:

ok answer is YES

Test #68:

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

input:

a
abaab

output:

Yes

result:

ok answer is YES

Test #69:

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

input:

a
abbaab

output:

Yes

result:

ok answer is YES

Test #70:

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

input:

a
aaaaaa

output:

No

result:

ok answer is NO

Test #71:

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

input:

bb
bba

output:

Yes

result:

ok answer is YES

Test #72:

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

input:

aa
aba

output:

Yes

result:

ok answer is YES

Test #73:

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

input:

bb
baab

output:

Yes

result:

ok answer is YES

Test #74:

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

input:

ba
baab

output:

Yes

result:

ok answer is YES

Test #75:

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

input:

bb
babaa

output:

Yes

result:

ok answer is YES

Test #76:

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

input:

aa
ababb

output:

Yes

result:

ok answer is YES

Test #77:

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

input:

ab
abbaba

output:

Yes

result:

ok answer is YES

Test #78:

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

input:

ba
bbaaba

output:

No

result:

ok answer is NO

Test #79:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

bba
bbaa

output:

Yes

result:

ok answer is YES

Test #80:

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

input:

bba
bbab

output:

Yes

result:

ok answer is YES

Test #81:

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

input:

aba
abbab

output:

Yes

result:

ok answer is YES

Test #82:

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

input:

abb
aabab

output:

No

result:

ok answer is NO

Test #83:

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

input:

aba
abaaba

output:

Yes

result:

ok answer is YES

Test #84:

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

input:

abb
ababbb

output:

Yes

result:

ok answer is YES

Test #85:

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

input:

aaba
aabaa

output:

Yes

result:

ok answer is YES

Test #86:

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

input:

aaab
aaaab

output:

No

result:

ok answer is NO

Test #87:

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

input:

bbab
bbaabb

output:

Yes

result:

ok answer is YES

Test #88:

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

input:

abbb
abbabb

output:

Yes

result:

ok answer is YES

Test #89:

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

input:

abaab
ababab

output:

Yes

result:

ok answer is YES

Test #90:

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

input:

bbbbb
bbbbba

output:

Yes

result:

ok answer is YES