QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#714770#6197. 太阳神的宴会NineSuns15 76ms124012kbC++141.5kb2024-11-06 06:40:522024-11-06 06:40:52

Judging History

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

  • [2024-11-06 06:40:52]
  • 评测
  • 测评结果:15
  • 用时:76ms
  • 内存:124012kb
  • [2024-11-06 06:40:52]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define pii pair <int, int>
#define fi first
#define se second
#define pb push_back

using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const int N = 1005, mod = 998244353; 
int n, tot, k, f[N*N], id[N*N], sz[N]; 
map <int, int> ch[N*N]; 
vector <int> las[N*N]; 
int pre[26]; 
struct trie {
	int rt; 
	void ins (string s, int l) {
		int p = rt;
		memset(pre, -1, sizeof pre);  
		for (int i = l;i < s.size();i++) {
			int x; 
			if (~pre[s[i]-'a']) {
				x = i-pre[s[i]-'a']; 
			}
			else x = 0; 
			if (las[p].empty()) {
				for (int j = 0;j < k;j++) if (~pre[j]) las[p].pb(i-pre[j]); 
			}
//			cout << "INS:" << s << " " << l << " " << i << " " << p << " " << las[p].size() << " " << x << endl; 
			pre[s[i]-'a'] = i; 
			if (ch[p].count(x)) p = ch[p][x]; 
			else {
				ch[p][x] = ++tot; p = tot; 
			}
		}
	}
}tr[N];

string str; 
void solve () {
	cin >> n >> k; 
	for (int i = 1;i <= n;i++) {
		int las = tot; 
		tr[i].rt = ++tot; 
		cin >> str; 
		for (int j = 0;j < str.size();j++) tr[i].ins(str, j); 
		for (int j = las+1;j <= tot;j++) id[j] = i;  
		sz[i] = tot-las-1; 
	}
	for (int i = 1;i <= tot;i++) if (las[i].size() < k) las[i].pb(0); 
	int ans = 0; ll v = k;  
	for (int i = 1;i <= n;i++) {
		(ans += sz[i]*v%mod) %= mod; 
		v = v*(1ll*sz[i]*(k-1)+1)%mod; 
	}
	cout << (ans+1)%mod; 
}

signed main () {
//	ios::sync_with_stdio(0);
//	cin.tie(0); cout.tie(0);
	int T = 1;
	while (T--) solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 2
Accepted

Test #1:

score: 2
Accepted
time: 53ms
memory: 114932kb

input:

1 2
bbbaabbbbbaabaabbababbabbaaabbaaabaaabbabbabbbaaabaababbbaabbbabaaaaabbbbbabbabbbbbabbaababaabbbababbbbabababbaabbbbabbbababbbaabaabbabbbbababaabbbbbabaaaaaabbbbbbbaaaaabbabbbbaaabaaabaababbbababaaaabbababaaabbababaabbbbaabababbbabbabaababbbabaababaaabaaabaaababaaaaabbaaaaabbabaababbababbbbbaaba...

output:

981227

result:

ok 1 number(s): "981227"

Test #2:

score: 2
Accepted
time: 53ms
memory: 116080kb

input:

1 2
abaabbababaaabbbabaaabbaabbbbaaabbbbbbaabbababbabbbbbbaaabbabbaabbbbbaababbaabbabababaaaaabaaabbbbaaaaabaababbbbaaabbabbaabaabaaabbbabaaaababbabbbaabbbaaabbbabbbbaaabbbbbababbababaaaaababbabbbbbbababbaabaaaabaaabaabbabbaabbbabababbbaabababaaaaabbbaaabaabaabbbaababaaabbbbabbbbbabaababbabbbaababab...

output:

981457

result:

ok 1 number(s): "981457"

Test #3:

score: 2
Accepted
time: 47ms
memory: 115228kb

input:

1 2
aaaaaababbbaabaaaabbaababbabaaabbbbbaabbababaaaabaabaabaaaabaababbaababbabbabbbaaaaaaabaabbaaaabaabaaaabaabbbabbaaababbbaaaabbbbababbbaaabbabbbababbbbbbbababbaaaabbbbbabbabbaabaaabaaaabbababbbaabbbbaababbbabbaababaabaaabaaaaaaaabaaabaaababaababbbababababbbbaababababbabbbbabaaaaababbbbabaaabbbabb...

output:

981717

result:

ok 1 number(s): "981717"

Test #4:

score: 2
Accepted
time: 39ms
memory: 97840kb

input:

1 2
abbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

549593

result:

ok 1 number(s): "549593"

Test #5:

score: 2
Accepted
time: 9ms
memory: 76128kb

input:

1 2
babbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

5989

result:

ok 1 number(s): "5989"

Test #6:

score: 2
Accepted
time: 15ms
memory: 74824kb

input:

1 2
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

3997

result:

ok 1 number(s): "3997"

Test #7:

score: 2
Accepted
time: 12ms
memory: 76900kb

input:

1 2
abbaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaabaaaba...

output:

11949

result:

ok 1 number(s): "11949"

Test #8:

score: 2
Accepted
time: 24ms
memory: 87204kb

input:

1 2
baabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbabbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaabbbbbbabaa...

output:

298323

result:

ok 1 number(s): "298323"

Test #9:

score: 2
Accepted
time: 7ms
memory: 75308kb

input:

1 2
bababbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbbabbba...

output:

11947

result:

ok 1 number(s): "11947"

Subtask #2:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #10:

score: 0
Wrong Answer
time: 76ms
memory: 124012kb

input:

1 5
badaeeaadaacedaaaabeabcabbcdbeadcabbaeaaabbdeecbdecaeaecceabebcddbdaaabddeadaeebebbcdcaedcacbaccdabeeeccbaebbadbdeabcbcdbccecacbecccadebbbdcacdcabdadaccadbaccbecdcccbbdbaaebeeabbdcbbeaadebecaccdcaeceabeaadbdecbecdbcccceabdaabcbaaeccbdebceeeeddceababaecabadeabaadeaabcbaaaabbcbcabcebdaebcbedcccaea...

output:

2470446

result:

wrong answer 1st numbers differ - expected: '59251641', found: '2470446'

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 13
Accepted

Dependency #1:

100%
Accepted

Test #46:

score: 13
Accepted
time: 52ms
memory: 116224kb

input:

2 2
aaababbabaaaabbaababbbaaabbbbbbbaababbbbbbbabbabbabbbbbbababbabbaababbbbbbbabaaaabbbababbbbabaabbaabbaaaaaaabaaababbaabbbabababababaaabbababaaabbaababaabbbaababaaaaaaabbaaababbaaabaabbaaaabaabbabaaabbbbbabaaabababababbaabaabbbabbaabaaabbababbbabaabbbabbbbaababbaabbabbbabababaaabaabbaaabbabababab...

output:

1959299

result:

ok 1 number(s): "1959299"

Test #47:

score: 13
Accepted
time: 36ms
memory: 116660kb

input:

2 2
bbaaababbbbbbbaabaaabbabbabbbbaabbabaaabababaaabbbbbababbbaaaababbabaaabaabbaaaabababaaabaaaaaaabaaabbbaabaaabbabbbabbbbaaaaaabaaabbbabbabbaabbbabaabaaaaabbbabbbabaabbbbbbababbabbabbbbbaaaaaabaabaaaaaabbabaabbaaabbbbabababbabbababbabaabbbabbbabbbbabbbababaabbabbabaaabaabbaaaaaabaabbbbabbbbababab...

output:

2932325

result:

ok 1 number(s): "2932325"

Test #48:

score: 13
Accepted
time: 36ms
memory: 116256kb

input:

2 2
bbbabaaaaabaabaabbaaaabababaabbababbbbbbaaaababbbbbbbbaaaaabbaaababbbaababaaababbabaaabaabbbabbababbabbabababbbbbbabbbbababbbaabbabaaaaababbaaabababbabaabbaaaabaaabaabbaabbabbabaaabbaaaaabbabaaaabaabbbababbabbbaabababbabbbbbbabbbababbbabbaaaaaabababababbaabbbbbaabbaaaabbaaababaaaabaabababaabbaaa...

output:

2932847

result:

ok 1 number(s): "2932847"

Test #49:

score: 13
Accepted
time: 28ms
memory: 95952kb

input:

2 2
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

998023

result:

ok 1 number(s): "998023"

Test #50:

score: 13
Accepted
time: 15ms
memory: 90444kb

input:

2 2
abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

1026221

result:

ok 1 number(s): "1026221"

Test #51:

score: 13
Accepted
time: 34ms
memory: 94068kb

input:

2 2
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

1372091

result:

ok 1 number(s): "1372091"

Test #52:

score: 13
Accepted
time: 12ms
memory: 76096kb

input:

2 2
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

7987

result:

ok 1 number(s): "7987"

Test #53:

score: 13
Accepted
time: 22ms
memory: 80048kb

input:

2 2
baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

364637

result:

ok 1 number(s): "364637"

Test #54:

score: 13
Accepted
time: 26ms
memory: 76900kb

input:

2 2
abaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbbabbaabbbb...

output:

59441

result:

ok 1 number(s): "59441"

Test #55:

score: 13
Accepted
time: 39ms
memory: 112652kb

input:

31 2
ababbabbbabbbbbaababbaaaabbbbabaaaabbabaabaaaabbbabbbabbbbabbbababaaaaabbbaababbabbabaaaabbaaaaabbabbaaabbaaaabbbaabbbbbbaaaababbabaaabaaabaabbbabaabbaaaaabbbaaaabbbbbbaaabbbaabbabaababaaabbabaaaaabbbbbaaabababaaaabbbbaabaabbbbbaabbabbbaababaabbbabbababaaaabbbababbbabbbbaaababaaaabaaaaaaaababaa...

output:

720427737

result:

ok 1 number(s): "720427737"

Test #56:

score: 13
Accepted
time: 27ms
memory: 111620kb

input:

31 2
aababaaaaabaaaabaaabbabbabaabbaaaaabbababbbbababaabbaaabaaaaabbbbabaabbbababaaababaaabaaaabbbaaababaabbbbabaabbabaababbaabaaaaababaabbbbaaababaaaabbbbababbbaaaaabbbbbaabbabbabbbaaabbbabaabaaabaaaabbbbbabbaababbbababbaaaabbaaaaaaababbabbbbbbabbaabbbbababababbbabbbbaaabbbaaaabbabbaaaaabaabaaaaaaa...

output:

571807039

result:

ok 1 number(s): "571807039"

Test #57:

score: 13
Accepted
time: 11ms
memory: 90564kb

input:

31 2
ababbaabbaabbbbaaaabbbbbaaaaabaabaaaaaaaabbbbaabbbbbbbbabaabbabaabbbabbbaaabbbbabaaaaaabbbbbbabbbbbbaababbabbabaaaaaabbaaababbaabbabbbabbbabaaaabaabbabbbbaaabbabbabbaabbabaabbabaaaabaabbabababaabbaaababababbaabaabaaabaaababbaaababaabaabbabbbbbbbbbbbaababaaaabbabbbbababbbbabbaababbbbaabbbaabbaba...

output:

325715314

result:

ok 1 number(s): "325715314"

Test #58:

score: 13
Accepted
time: 17ms
memory: 85400kb

input:

31 2
abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

788272657

result:

ok 1 number(s): "788272657"

Test #59:

score: 13
Accepted
time: 9ms
memory: 75568kb

input:

31 2
abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

830805666

result:

ok 1 number(s): "830805666"

Test #60:

score: 13
Accepted
time: 19ms
memory: 80656kb

input:

31 2
abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

744200473

result:

ok 1 number(s): "744200473"

Test #61:

score: 13
Accepted
time: 31ms
memory: 93808kb

input:

31 2
baabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaabbaa...

output:

351845541

result:

ok 1 number(s): "351845541"

Test #62:

score: 13
Accepted
time: 10ms
memory: 77448kb

input:

31 2
ababaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbabaaaaaabbaba...

output:

400428613

result:

ok 1 number(s): "400428613"

Test #63:

score: 13
Accepted
time: 26ms
memory: 83140kb

input:

31 2
abaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaa...

output:

328678714

result:

ok 1 number(s): "328678714"

Test #64:

score: 13
Accepted
time: 11ms
memory: 75020kb

input:

1000 2
b
b
a
b
a
a
a
b
b
a
b
b
b
b
b
a
b
b
b
b
b
a
b
b
a
a
b
b
b
a
b
a
b
b
a
a
a
a
a
a
b
b
a
b
a
a
a
b
b
b
a
b
a
b
b
a
a
a
a
a
b
a
a
b
b
b
a
b
b
b
a
a
b
b
a
b
a
b
b
b
b
b
b
b
a
b
a
a
a
a
a
b
a
b
b
a
b
a
a
a
b
b
a
a
b
a
b
b
b
a
b
a
a
b
a
b
b
b
b
a
a
b
b
a
a
b
a
a
b
b
b
b
b
a
b
a
b
b
a
a
b
b
b
a
b
a
b...

output:

46452553

result:

ok 1 number(s): "46452553"

Subtask #5:

score: 0
Skipped

Dependency #2:

0%

Subtask #6:

score: 0
Runtime Error

Dependency #4:

100%
Accepted

Test #102:

score: 0
Runtime Error

input:

2 5
dabcabbaaaacebcdbacedeedeadecadeacdddddcaaddadcedeababacabacbcaabccdcdceaebadcddceebbebbecdebabbedddbbdedbaebccbbebbaeeebbdaeeedebbcbdccdecadeeaeedddccabddbddebecdeaebbaaabdddaeadacaddeeaddcbbbddecbcbdbaedcdacbbcaecdccbcedaecdecedeccaacdeddacbbaccebebadcdeeacbabacabdabdecdadbceadecceaccabaadadbd...

output:


result:


Subtask #7:

score: 0
Skipped

Dependency #3:

0%