QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#293750#4893. Imbalance275307894a50 554ms36700kbC++142.9kb2023-12-29 18:07:152023-12-29 18:07:16

Judging History

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

  • [2023-12-29 18:07:16]
  • 评测
  • 测评结果:50
  • 用时:554ms
  • 内存:36700kb
  • [2023-12-29 18:07:15]
  • 提交

answer

#include<bits/stdc++.h>
#define Gc() getchar() 
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define eb emplace_back
using namespace std;using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned long long;using pii=pair<int,int>;
const int N=114+5,M=(1<<21)+5,K=(1<<25)+5,mod=998244353,Mod=mod-1;const db eps=1e-9;const int INF=1e9+7;mt19937 rnd(time(0));
int n,k,m;char c[N];
namespace Solve1{
	ll f[M],g[M];
	void Solve(){ 
		int i,j,t=0;for(i=1;i<=m;i++) t=t>>1|(c[i]-'0'<<k-2);
		f[t]=1;
		for(i=m+1;i<=n;i++){
			Mc(g,f);Me(f,0);
			for(j=0;j<(1<<k-1);j++)if(g[j])for(int o=0;o<2;o++){
				int h=j|(o<<k-1);
				if(i>=k&&__builtin_popcount(h)==k/2) continue;
				f[h>>1]=(f[h>>1]+g[j])%mod;
			}
		}
		ll tot=0;for(i=0;i<(1<<k-1);i++) tot+=f[i];
		printf("%lld\n",tot%mod);
	}
}
int A[N],vis[N][N];
ll ans,pth[N][N][N],dp[N][N];
int s,t;
void DP(int id){
	for(int i=1;i<=k;i++)for(int j=0;j<=n;j++)if(!vis[i][j]){
		dp[i][j]+=dp[i-1][j];
		if(j) dp[i][j]=(dp[i-1][j-1]+dp[i][j])%mod;
	}
	for(int i=0;i<=n;i++) pth[t+n/k*(k/2)][id][i]=dp[k][i];
	pth[t+n/k*(k/2)][id][n+1]=dp[n%k][t];
}
int pt[N];
ll mat[6][6];
ll det(){
	ll ans=1;
	for(int i=0;i<=n/k;i++){
		for(int j=i+1;j<=n/k;j++)while(mat[j][i]){
			int x=mod-mat[i][i]/mat[j][i];
			for(int h=i;h<=n/k;h++) mat[i][h]=(mat[i][h]+x*mat[j][h])%mod;
			swap(mat[i],mat[j]);
			ans*=-1;
		}
	}
	for(int i=0;i<=n/k;i++) ans=ans*mat[i][i]%mod;
	return (ans%mod+mod)%mod;
}
int cts;
void qry(){
	cts++;
	for(int i=0;i<=n/k;i++) for(int j=0;j<=n/k;j++){
		int x=(i?pt[i]-i*(k/2):n+1),y=(j<n/k?pt[j+1]-j*(k/2):n+1);
		mat[i][j]=pth[t][x][y];
	}
	ans+=det();
	// for(int i=1;i<=n/k;i++) cerr<<pt[i]<<' ';cerr<<t<<'\n';
	// cerr<<ans<<'\n';
	// if(cts%1000==0) cerr<<cts<<'\n';
}
void dfs(int x,int w){
	if(x>n){
		for(int i=w;i<=w+n-(x-k);i++) t=i+(x-k)/2,qry();
		return;
	}
	for(int i=w+1;i<=w+k/2;i++) pt[x/k]=i+x/2,dfs(x+k,i);
}
void calc(){
	int i,j,h;
	for(i=1;i<=m;i++)A[i]=A[i-1]+c[i]-'0';s=A[m];
	Me(vis,0);for(i=0;i<m;i++){
		for(j=0;j<=A[i];j++) vis[i][j]=1;
	}
	Me(pth,0);
	for(i=0;i<=n;i++){
		t=i-n/k*(k/2);
		if(t<=0||vis[n%k][t]) continue;
		for(j=0;j<=n%k;j++) for(h=t+1;h<=n;h++) vis[j][h]++;
		Me(dp,0);if(!vis[m][s]) dp[m][s]=1;DP(n+1);
		for(j=0;j<=n;j++){
			Me(dp,0);if(!vis[0][j]) dp[0][j]=1;DP(j);
		}
		for(j=0;j<=n%k;j++) for(h=t+1;h<=n;h++) vis[j][h]--;
	}
	dfs(k,0);
}
void Solve(){
	int i,j;scanf("%d%d%d",&n,&k,&m);
	scanf("%s",c+1);
	if(k<=20){return Solve1::Solve();}
	calc();
	for(i=1;i<=m;i++) c[i]^=1;
	calc();
	printf("%ld\n",ans%mod);
}
int main(){
    int t=1;
    // scanf("%d",&t);
    while(t--) Solve();
    cerr<<clock()*1.0/CLOCKS_PER_SEC<<'\n';
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 8ms
memory: 36628kb

input:

2 2 0

output:

2

result:

ok 1 number(s): "2"

Test #2:

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

input:

2 2 1
0

output:

1

result:

ok 1 number(s): "1"

Test #3:

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

input:

3 2 0

output:

2

result:

ok 1 number(s): "2"

Test #4:

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

input:

3 2 1
0

output:

1

result:

ok 1 number(s): "1"

Test #5:

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

input:

4 2 0

output:

2

result:

ok 1 number(s): "2"

Test #6:

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

input:

4 2 1
0

output:

1

result:

ok 1 number(s): "1"

Test #7:

score: 0
Accepted
time: 11ms
memory: 36636kb

input:

4 4 0

output:

10

result:

ok 1 number(s): "10"

Test #8:

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

input:

4 4 1
1

output:

5

result:

ok 1 number(s): "5"

Test #9:

score: 0
Accepted
time: 11ms
memory: 36628kb

input:

4 4 2
00

output:

3

result:

ok 1 number(s): "3"

Test #10:

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

input:

4 4 3
101

output:

1

result:

ok 1 number(s): "1"

Test #11:

score: 0
Accepted
time: 12ms
memory: 36596kb

input:

5 2 0

output:

2

result:

ok 1 number(s): "2"

Test #12:

score: 0
Accepted
time: 11ms
memory: 36528kb

input:

5 2 1
1

output:

1

result:

ok 1 number(s): "1"

Test #13:

score: 0
Accepted
time: 12ms
memory: 36696kb

input:

5 4 0

output:

14

result:

ok 1 number(s): "14"

Test #14:

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

input:

5 4 1
0

output:

7

result:

ok 1 number(s): "7"

Test #15:

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

input:

5 4 2
01

output:

3

result:

ok 1 number(s): "3"

Test #16:

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

input:

5 4 3
110

output:

1

result:

ok 1 number(s): "1"

Test #17:

score: 0
Accepted
time: 36ms
memory: 36636kb

input:

17 2 0

output:

2

result:

ok 1 number(s): "2"

Test #18:

score: 0
Accepted
time: 28ms
memory: 36556kb

input:

17 2 0

output:

2

result:

ok 1 number(s): "2"

Test #19:

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

input:

17 10 6
110111

output:

621

result:

ok 1 number(s): "621"

Test #20:

score: 0
Accepted
time: 33ms
memory: 36584kb

input:

17 10 2
11

output:

8413

result:

ok 1 number(s): "8413"

Test #21:

score: 0
Accepted
time: 31ms
memory: 36588kb

input:

18 2 1
1

output:

1

result:

ok 1 number(s): "1"

Test #22:

score: 0
Accepted
time: 35ms
memory: 36596kb

input:

18 2 1
1

output:

1

result:

ok 1 number(s): "1"

Test #23:

score: 0
Accepted
time: 29ms
memory: 36644kb

input:

18 8 5
00010

output:

918

result:

ok 1 number(s): "918"

Test #24:

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

input:

18 8 3
001

output:

3404

result:

ok 1 number(s): "3404"

Test #25:

score: 0
Accepted
time: 20ms
memory: 36588kb

input:

18 16 6
100011

output:

2458

result:

ok 1 number(s): "2458"

Test #26:

score: 0
Accepted
time: 16ms
memory: 36596kb

input:

18 16 8
00101101

output:

548

result:

ok 1 number(s): "548"

Test #27:

score: 0
Accepted
time: 34ms
memory: 36696kb

input:

19 2 1
1

output:

1

result:

ok 1 number(s): "1"

Test #28:

score: 0
Accepted
time: 30ms
memory: 36628kb

input:

19 2 0

output:

2

result:

ok 1 number(s): "2"

Test #29:

score: 0
Accepted
time: 28ms
memory: 36624kb

input:

19 6 2
00

output:

3413

result:

ok 1 number(s): "3413"

Test #30:

score: 0
Accepted
time: 32ms
memory: 36588kb

input:

19 6 1
1

output:

7012

result:

ok 1 number(s): "7012"

Test #31:

score: 0
Accepted
time: 21ms
memory: 36512kb

input:

19 12 10
1010110000

output:

266

result:

ok 1 number(s): "266"

Test #32:

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

input:

19 12 3
111

output:

19234

result:

ok 1 number(s): "19234"

Test #33:

score: 0
Accepted
time: 32ms
memory: 36636kb

input:

19 16 2
10

output:

77876

result:

ok 1 number(s): "77876"

Test #34:

score: 0
Accepted
time: 36ms
memory: 36588kb

input:

19 16 0

output:

301208

result:

ok 1 number(s): "301208"

Test #35:

score: 0
Accepted
time: 30ms
memory: 36644kb

input:

20 2 1
0

output:

1

result:

ok 1 number(s): "1"

Test #36:

score: 0
Accepted
time: 35ms
memory: 36632kb

input:

20 2 0

output:

2

result:

ok 1 number(s): "2"

Test #37:

score: 0
Accepted
time: 19ms
memory: 36588kb

input:

20 10 9
110111000

output:

76

result:

ok 1 number(s): "76"

Test #38:

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

input:

20 10 9
110101110

output:

372

result:

ok 1 number(s): "372"

Test #39:

score: 0
Accepted
time: 15ms
memory: 36640kb

input:

20 14 11
10110110000

output:

207

result:

ok 1 number(s): "207"

Test #40:

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

input:

20 14 7
0011011

output:

3675

result:

ok 1 number(s): "3675"

Test #41:

score: 0
Accepted
time: 11ms
memory: 36580kb

input:

20 20 14
10111010000000

output:

58

result:

ok 1 number(s): "58"

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #42:

score: 10
Accepted
time: 158ms
memory: 36640kb

input:

114 12 11
11010000010

output:

394940507

result:

ok 1 number(s): "394940507"

Test #43:

score: 0
Accepted
time: 189ms
memory: 36576kb

input:

114 12 2
01

output:

60509873

result:

ok 1 number(s): "60509873"

Test #44:

score: 0
Accepted
time: 163ms
memory: 36644kb

input:

114 14 10
1001111011

output:

154687039

result:

ok 1 number(s): "154687039"

Test #45:

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

input:

114 14 5
00100

output:

941826071

result:

ok 1 number(s): "941826071"

Test #46:

score: 0
Accepted
time: 195ms
memory: 36624kb

input:

114 16 10
1011101001

output:

391666362

result:

ok 1 number(s): "391666362"

Test #47:

score: 0
Accepted
time: 164ms
memory: 36632kb

input:

114 16 15
000010011111010

output:

599226561

result:

ok 1 number(s): "599226561"

Test #48:

score: 0
Accepted
time: 274ms
memory: 36580kb

input:

114 18 1
0

output:

167675624

result:

ok 1 number(s): "167675624"

Test #49:

score: 0
Accepted
time: 247ms
memory: 36580kb

input:

114 18 8
11000001

output:

165986235

result:

ok 1 number(s): "165986235"

Test #50:

score: 0
Accepted
time: 455ms
memory: 36700kb

input:

114 20 17
11101000010011010

output:

852476378

result:

ok 1 number(s): "852476378"

Test #51:

score: 0
Accepted
time: 471ms
memory: 36644kb

input:

114 20 13
1101011010000

output:

974712368

result:

ok 1 number(s): "974712368"

Test #52:

score: 0
Accepted
time: 171ms
memory: 36528kb

input:

113 12 8
10101100

output:

754580060

result:

ok 1 number(s): "754580060"

Test #53:

score: 0
Accepted
time: 170ms
memory: 36516kb

input:

113 12 10
1110010010

output:

928476173

result:

ok 1 number(s): "928476173"

Test #54:

score: 0
Accepted
time: 182ms
memory: 36692kb

input:

113 14 9
010111000

output:

930953494

result:

ok 1 number(s): "930953494"

Test #55:

score: 0
Accepted
time: 171ms
memory: 36648kb

input:

113 14 0

output:

613264431

result:

ok 1 number(s): "613264431"

Test #56:

score: 0
Accepted
time: 201ms
memory: 36584kb

input:

113 16 4
0011

output:

966491874

result:

ok 1 number(s): "966491874"

Test #57:

score: 0
Accepted
time: 176ms
memory: 36580kb

input:

113 16 10
1110110011

output:

71975445

result:

ok 1 number(s): "71975445"

Test #58:

score: 0
Accepted
time: 262ms
memory: 36532kb

input:

113 18 2
01

output:

35416931

result:

ok 1 number(s): "35416931"

Test #59:

score: 0
Accepted
time: 250ms
memory: 36692kb

input:

113 18 11
01101011111

output:

605684813

result:

ok 1 number(s): "605684813"

Test #60:

score: 0
Accepted
time: 535ms
memory: 36640kb

input:

113 20 1
1

output:

970488755

result:

ok 1 number(s): "970488755"

Test #61:

score: 0
Accepted
time: 456ms
memory: 36524kb

input:

113 20 17
10000001101111001

output:

308768022

result:

ok 1 number(s): "308768022"

Test #62:

score: 0
Accepted
time: 153ms
memory: 36696kb

input:

112 12 10
1011100000

output:

379472486

result:

ok 1 number(s): "379472486"

Test #63:

score: 0
Accepted
time: 163ms
memory: 36524kb

input:

112 12 3
111

output:

876338776

result:

ok 1 number(s): "876338776"

Test #64:

score: 0
Accepted
time: 164ms
memory: 36528kb

input:

112 14 6
100111

output:

850899867

result:

ok 1 number(s): "850899867"

Test #65:

score: 0
Accepted
time: 150ms
memory: 36692kb

input:

112 14 11
11011001011

output:

579315503

result:

ok 1 number(s): "579315503"

Test #66:

score: 0
Accepted
time: 175ms
memory: 36560kb

input:

112 16 11
00000111111

output:

827780781

result:

ok 1 number(s): "827780781"

Test #67:

score: 0
Accepted
time: 172ms
memory: 36592kb

input:

112 16 9
101001101

output:

247916257

result:

ok 1 number(s): "247916257"

Test #68:

score: 0
Accepted
time: 193ms
memory: 36628kb

input:

112 18 16
0011000001111001

output:

740632908

result:

ok 1 number(s): "740632908"

Test #69:

score: 0
Accepted
time: 249ms
memory: 36636kb

input:

112 18 4
0010

output:

594108528

result:

ok 1 number(s): "594108528"

Test #70:

score: 0
Accepted
time: 496ms
memory: 36596kb

input:

112 20 7
1010100

output:

818166882

result:

ok 1 number(s): "818166882"

Test #71:

score: 0
Accepted
time: 320ms
memory: 36596kb

input:

112 20 16
0001100100101000

output:

222914924

result:

ok 1 number(s): "222914924"

Test #72:

score: 0
Accepted
time: 166ms
memory: 36596kb

input:

111 12 2
11

output:

895626591

result:

ok 1 number(s): "895626591"

Test #73:

score: 0
Accepted
time: 175ms
memory: 36584kb

input:

111 12 1
1

output:

543447881

result:

ok 1 number(s): "543447881"

Test #74:

score: 0
Accepted
time: 172ms
memory: 36636kb

input:

111 14 3
111

output:

555958815

result:

ok 1 number(s): "555958815"

Test #75:

score: 0
Accepted
time: 156ms
memory: 36692kb

input:

111 14 13
1110001101010

output:

47749667

result:

ok 1 number(s): "47749667"

Test #76:

score: 0
Accepted
time: 194ms
memory: 36636kb

input:

111 16 5
01000

output:

880732287

result:

ok 1 number(s): "880732287"

Test #77:

score: 0
Accepted
time: 173ms
memory: 36636kb

input:

111 16 7
0110010

output:

153134396

result:

ok 1 number(s): "153134396"

Test #78:

score: 0
Accepted
time: 182ms
memory: 36592kb

input:

111 18 17
11011101001111100

output:

718197735

result:

ok 1 number(s): "718197735"

Test #79:

score: 0
Accepted
time: 238ms
memory: 36524kb

input:

111 18 9
011110101

output:

78875109

result:

ok 1 number(s): "78875109"

Test #80:

score: 0
Accepted
time: 487ms
memory: 36580kb

input:

111 20 6
100101

output:

484008568

result:

ok 1 number(s): "484008568"

Test #81:

score: 0
Accepted
time: 293ms
memory: 36628kb

input:

111 20 19
1100110110001010110

output:

612558978

result:

ok 1 number(s): "612558978"

Test #82:

score: 0
Accepted
time: 412ms
memory: 36580kb

input:

102 20 10
0101000100

output:

678899105

result:

ok 1 number(s): "678899105"

Test #83:

score: 0
Accepted
time: 145ms
memory: 36592kb

input:

97 16 13
0101110011010

output:

456291266

result:

ok 1 number(s): "456291266"

Subtask #3:

score: 30
Accepted

Dependency #1:

100%
Accepted

Test #84:

score: 30
Accepted
time: 270ms
memory: 36632kb

input:

66 20 5
11001

output:

286180948

result:

ok 1 number(s): "286180948"

Test #85:

score: 0
Accepted
time: 135ms
memory: 36580kb

input:

66 20 19
0101001111011100100

output:

334317215

result:

ok 1 number(s): "334317215"

Test #86:

score: 0
Accepted
time: 20ms
memory: 17192kb

input:

66 22 19
1001101100000100001

output:

465510840

result:

ok 1 number(s): "465510840"

Test #87:

score: 0
Accepted
time: 24ms
memory: 17216kb

input:

66 22 11
10001111000

output:

731812403

result:

ok 1 number(s): "731812403"

Test #88:

score: 0
Accepted
time: 19ms
memory: 17160kb

input:

66 24 6
011111

output:

270615978

result:

ok 1 number(s): "270615978"

Test #89:

score: 0
Accepted
time: 18ms
memory: 17084kb

input:

66 24 6
010001

output:

800866476

result:

ok 1 number(s): "800866476"

Test #90:

score: 0
Accepted
time: 19ms
memory: 17264kb

input:

66 26 11
01110011011

output:

292876310

result:

ok 1 number(s): "292876310"

Test #91:

score: 0
Accepted
time: 19ms
memory: 17256kb

input:

66 26 3
110

output:

269818127

result:

ok 1 number(s): "269818127"

Test #92:

score: 0
Accepted
time: 20ms
memory: 17148kb

input:

66 28 22
1111000101010111010110

output:

25687950

result:

ok 1 number(s): "25687950"

Test #93:

score: 0
Accepted
time: 19ms
memory: 17260kb

input:

66 28 7
0010101

output:

21960392

result:

ok 1 number(s): "21960392"

Test #94:

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

input:

66 30 16
1111000000011010

output:

599613456

result:

ok 1 number(s): "599613456"

Test #95:

score: 0
Accepted
time: 21ms
memory: 17204kb

input:

66 30 22
0010101110011001011100

output:

332331060

result:

ok 1 number(s): "332331060"

Test #96:

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

input:

66 32 12
011100101111

output:

692517940

result:

ok 1 number(s): "692517940"

Test #97:

score: 0
Accepted
time: 19ms
memory: 17156kb

input:

66 32 16
0100100100101001

output:

967944648

result:

ok 1 number(s): "967944648"

Test #98:

score: 0
Accepted
time: 277ms
memory: 36636kb

input:

65 20 1
1

output:

42155886

result:

ok 1 number(s): "42155886"

Test #99:

score: 0
Accepted
time: 143ms
memory: 36584kb

input:

65 20 17
10010110011011111

output:

178005033

result:

ok 1 number(s): "178005033"

Test #100:

score: 0
Accepted
time: 19ms
memory: 17092kb

input:

65 22 16
0001011100100000

output:

785335838

result:

ok 1 number(s): "785335838"

Test #101:

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

input:

65 22 13
1001101010101

output:

440523928

result:

ok 1 number(s): "440523928"

Test #102:

score: 0
Accepted
time: 19ms
memory: 17160kb

input:

65 24 0

output:

477090711

result:

ok 1 number(s): "477090711"

Test #103:

score: 0
Accepted
time: 21ms
memory: 17200kb

input:

65 24 14
10111111011101

output:

263900154

result:

ok 1 number(s): "263900154"

Test #104:

score: 0
Accepted
time: 21ms
memory: 17212kb

input:

65 26 10
1100111010

output:

343121911

result:

ok 1 number(s): "343121911"

Test #105:

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

input:

65 26 2
01

output:

1028654

result:

ok 1 number(s): "1028654"

Test #106:

score: 0
Accepted
time: 19ms
memory: 17196kb

input:

65 28 11
00010110101

output:

977003245

result:

ok 1 number(s): "977003245"

Test #107:

score: 0
Accepted
time: 19ms
memory: 17156kb

input:

65 28 25
1010000011011011000010010

output:

59779597

result:

ok 1 number(s): "59779597"

Test #108:

score: 0
Accepted
time: 17ms
memory: 17152kb

input:

65 30 12
011010110110

output:

28981686

result:

ok 1 number(s): "28981686"

Test #109:

score: 0
Accepted
time: 18ms
memory: 17096kb

input:

65 30 5
01111

output:

901067934

result:

ok 1 number(s): "901067934"

Test #110:

score: 0
Accepted
time: 17ms
memory: 17260kb

input:

65 32 9
101100011

output:

523898023

result:

ok 1 number(s): "523898023"

Test #111:

score: 0
Accepted
time: 21ms
memory: 17148kb

input:

65 32 31
1010100001010000110110000001000

output:

173664576

result:

ok 1 number(s): "173664576"

Test #112:

score: 0
Accepted
time: 276ms
memory: 36592kb

input:

64 20 2
10

output:

213928626

result:

ok 1 number(s): "213928626"

Test #113:

score: 0
Accepted
time: 169ms
memory: 36596kb

input:

64 20 17
01110111010001000

output:

629845990

result:

ok 1 number(s): "629845990"

Test #114:

score: 0
Accepted
time: 16ms
memory: 17152kb

input:

64 22 4
0101

output:

755608618

result:

ok 1 number(s): "755608618"

Test #115:

score: 0
Accepted
time: 17ms
memory: 17136kb

input:

64 22 20
00010010100011111010

output:

381748139

result:

ok 1 number(s): "381748139"

Test #116:

score: 0
Accepted
time: 21ms
memory: 17204kb

input:

64 24 9
100110100

output:

508203808

result:

ok 1 number(s): "508203808"

Test #117:

score: 0
Accepted
time: 21ms
memory: 17140kb

input:

64 24 17
11100000110000111

output:

271951917

result:

ok 1 number(s): "271951917"

Test #118:

score: 0
Accepted
time: 18ms
memory: 17196kb

input:

64 26 16
1100111111111110

output:

947719454

result:

ok 1 number(s): "947719454"

Test #119:

score: 0
Accepted
time: 14ms
memory: 17148kb

input:

64 26 18
101001101111101011

output:

557651914

result:

ok 1 number(s): "557651914"

Test #120:

score: 0
Accepted
time: 14ms
memory: 17200kb

input:

64 28 7
0011101

output:

659928242

result:

ok 1 number(s): "659928242"

Test #121:

score: 0
Accepted
time: 15ms
memory: 17260kb

input:

64 28 10
1100010011

output:

724166061

result:

ok 1 number(s): "724166061"

Test #122:

score: 0
Accepted
time: 18ms
memory: 17156kb

input:

64 30 2
10

output:

922542306

result:

ok 1 number(s): "922542306"

Test #123:

score: 0
Accepted
time: 18ms
memory: 17076kb

input:

64 30 2
10

output:

922542306

result:

ok 1 number(s): "922542306"

Test #124:

score: 0
Accepted
time: 16ms
memory: 17212kb

input:

64 32 14
00100000110010

output:

772135024

result:

ok 1 number(s): "772135024"

Test #125:

score: 0
Accepted
time: 24ms
memory: 17160kb

input:

64 32 19
0110111111001010010

output:

301836349

result:

ok 1 number(s): "301836349"

Test #126:

score: 0
Accepted
time: 28ms
memory: 17208kb

input:

66 48 10
1100101011

output:

250609010

result:

ok 1 number(s): "250609010"

Test #127:

score: 0
Accepted
time: 35ms
memory: 17200kb

input:

66 66 29
01110011011101001000011110101

output:

746018049

result:

ok 1 number(s): "746018049"

Test #128:

score: 0
Accepted
time: 99ms
memory: 36588kb

input:

66 14 7
1001101

output:

871164400

result:

ok 1 number(s): "871164400"

Test #129:

score: 0
Accepted
time: 19ms
memory: 17080kb

input:

66 24 1
0

output:

584525706

result:

ok 1 number(s): "584525706"

Test #130:

score: 0
Accepted
time: 19ms
memory: 17160kb

input:

66 24 2
11

output:

317970168

result:

ok 1 number(s): "317970168"

Test #131:

score: 0
Accepted
time: 19ms
memory: 17144kb

input:

66 26 1
0

output:

391681574

result:

ok 1 number(s): "391681574"

Test #132:

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

input:

66 26 2
00

output:

97862478

result:

ok 1 number(s): "97862478"

Test #133:

score: 0
Accepted
time: 19ms
memory: 17136kb

input:

66 28 1
0

output:

964005824

result:

ok 1 number(s): "964005824"

Test #134:

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

input:

66 28 2
11

output:

521812451

result:

ok 1 number(s): "521812451"

Test #135:

score: 0
Accepted
time: 13ms
memory: 17136kb

input:

57 24 10
0111100111

output:

275357201

result:

ok 1 number(s): "275357201"

Test #136:

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

input:

57 56 13
0111001000100

output:

712420784

result:

ok 1 number(s): "712420784"

Subtask #4:

score: 0
Time Limit Exceeded

Test #137:

score: 20
Accepted
time: 554ms
memory: 36524kb

input:

114 20 0

output:

849724285

result:

ok 1 number(s): "849724285"

Test #138:

score: -20
Time Limit Exceeded

input:

114 22 0

output:


result:


Subtask #5:

score: 0
Skipped

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%