QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#96132#122. Security Gatetricyzhkx100 ✓372ms342932kbC++143.8kb2023-04-13 12:45:302023-04-13 12:45:31

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-13 12:45:31]
  • 评测
  • 测评结果:100
  • 用时:372ms
  • 内存:342932kb
  • [2023-04-13 12:45:30]
  • 提交

answer

# include <bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
typedef long long ll;
char s[310];
int f[310][310][310],f1[310][310],f2[310][310],g[310][310][310],g1[310][310],g2[310][310],hf[310][310][610],hg[310][310][610],h[310][310][310],pre[310];
template<typename T>
void upd(int &a,T b){a=(a+b)%mod;}
int main()
{
	int n,ans=0;
	scanf("%d%s",&n,s+1);
	if(n&1) return puts("0"),0;
	f[0][0][0]=g[n][0][0]=1;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<=i;j++)
			for(int k=0;k<=j;k++)
				for(int l:{-1,1})
				{
					if((s[i+1]=='(' && l<0) || (s[i+1]==')' && l>0)) continue;
					if(k+l<0) upd(hf[i+1][j][n-1],f[i][j][k]);
					else upd(f[i+1][max(j,k+l)][k+l],f[i][j][k]);
				}
		for(int j=0;j<=i;j++)
			for(int k=n-i;k<=n+i;k++)
				for(int l:{-1,1})
				{
					if((s[i+1]=='(' && l<0) || (s[i+1]==')' && l>0)) continue;
					if(k+l<=n+2*j) upd(hf[i+1][j][k+l],hf[i][j][k]);
				}
	}
	for(int i=n;i>0;i--)
	{
		for(int j=0;j<=n-i;j++)
			for(int k=0;k<=j;k++)
				for(int l:{-1,1})
				{
					if((s[i]=='(' && l>0) || (s[i]==')' && l<0)) continue;
					if(k+l<0) upd(hg[i-1][j][n-1],g[i][j][k]);
					else upd(g[i-1][max(j,k+l)][k+l],g[i][j][k]);
				}
		for(int j=0;j<=n-i;j++)
			for(int k=n-(n-i);k<=n+(n-i);k++)
				for(int l:{-1,1})
				{
					if((s[i]=='(' && l>0) || (s[i]==')' && l<0)) continue;
					if(k+l<=n+2*j) upd(hg[i-1][j][k+l],hg[i][j][k]);
				}
	}
	for(int i=0;i<=n;i++)
		for(int j=n;j>=0;j--)
			f1[i][j]=(f1[i][j+1]+f[i][j][0])%mod;
	for(int i=0;i<=n;i++)
		for(int j=n;j>=0;j--)
			g1[i][j]=(g1[i][j+1]+g[i][j][0])%mod;
	for(int i=1;i<n;i+=2)if(s[i+1]!=')')
		for(int j=0;j<=i;j++)
			for(int k=n-i;k<=n+i;k+=2)
			{
				int S=k-n+1;
				upd(ans,(ll)hf[i][j][k]*g1[i+1][max(j-S/2+1,0)]);
			}
	for(int i=n-1;i>0;i-=2)if(s[i]!='(')
		for(int j=0;j<=n-i;j++)
			for(int k=n-(n-i);k<=n+(n-i);k+=2)
			{
				int S=k-n+1;
				upd(ans,(ll)hg[i][j][k]*f1[i-1][max(j-S/2,0)]);
			}
	for(int i=0;i<=n;i++)
		for(int j=0;j<=i;j++)
			for(int k=0;k<=j;k++)
				upd(f2[i][k],f[i][j][k]);
	for(int i=0;i<=n;i++)
		for(int j=0;j<=n-i;j++)
			for(int k=0;k<=j;k++)
				upd(g2[i][k],g[i][j][k]);
	for(int i=0;i<=n;i++)
	{
		for(int j=0;j<=i;j++) memset(hf[i][j],0,sizeof(int)*(2*n+1));
		for(int j=0;j<=n-i;j++) memset(hg[i][j],0,sizeof(int)*(2*n+1));
	}
	for(int i=0;i<n;i++)
	{
		if(s[i+1]!=')') for(int j=1;j<=i;j++) upd(hf[i+1][j][j+1],f2[i][j]);
		for(int j=0;j<=i;j++)
			for(int k=0;k<=i;k++)
				for(int l:{-1,1})
				{
					if((s[i+1]=='(' && l<0) || (s[i+1]==')' && l>0)) continue;
					if(k+l>j && k+l<=2*j) upd(hf[i+1][j][k+l],hf[i][j][k]);
				}
	}
	for(int i=n;i>0;i--)
	{
		if(s[i]!='(') for(int j=1;j<=n-i;j++) upd(hg[i-1][j][j+1],g2[i][j]);
		for(int j=0;j<=n-i;j++)
			for(int k=0;k<=n-i;k++)
				for(int l:{-1,1})
				{
					if((s[i]=='(' && l>0) || (s[i]==')' && l<0)) continue;
					if(k+l>j && k+l<=2*j) upd(hg[i-1][j][k+l],hg[i][j][k]);
				}
	}
	for(int i=1;i<n;i+=2)if(s[i+1]!=')')
		for(int j=0;j<=i;j++)
			for(int k=1;k<=i;k+=2)
			{
				int S=k+1;
				if(j>=S/2) upd(ans,(ll)hf[i][j][k]*g[i+1][j-S/2][0]);
			}
	for(int i=n-1;i>0;i-=2)if(s[i]!='(')
		for(int j=0;j<=n-i;j++)
			for(int k=1;k<=n-i;k+=2)
			{
				int S=k+1;
				if(j>=S/2) upd(ans,(ll)hg[i][j][k]*f[i-1][j-S/2][0]);
			}
	for(int i=1;i<n;i+=2)if(s[i+1]!=')')
	{
		for(int j=0;j<=(n-i-1)/2;j++)
			for(int k=1;k<=2*j-1 && k<=i;k+=2)
				upd(ans,(ll)f2[i][k]*g[i+1][j][0]);
		for(int j=1;j<=i;j+=2)
			upd(ans,(ll)f2[i][j]*g[i+1][(j-1)/2][0]);
	}
	for(int i=n-1;i>0;i-=2)if(s[i]!='(')
	{
		for(int j=0;j<=(i-1)/2;j++)
			for(int k=1;k<=2*j-1 && k<=n-i;k+=2)
				upd(ans,(ll)g2[i][k]*f[i-1][j][0]);
		for(int j=1;j<=n-i;j+=2)
			upd(ans,(ll)g2[i][j]*f[i-1][(j-1)/2][0]);
	}
	upd(ans,f2[n][0]);
	cout<<ans<<endl;
	return 0;
}

詳細信息

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 3ms
memory: 7836kb

input:

2
xx

output:

4

result:

ok single line: '4'

Test #2:

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

input:

100
(()())()()()(()()(())(()))(())()(()()())(()())()()()(())((()()(()())(((()(()()()())((((()())))))))))

output:

1

result:

ok single line: '1'

Test #3:

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

input:

97
)((()(()(()))()(()(()))(((()(())()()())(())(((((()())))())())(()((()(())))(()())(()()())(()((())(

output:

0

result:

ok single line: '0'

Test #4:

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

input:

4
xxx(

output:

6

result:

ok single line: '6'

Test #5:

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

input:

34
)())()()(()(())(()(((()))))(()()((

output:

0

result:

ok single line: '0'

Test #6:

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

input:

44
))))x)((()(x())x)())x)(()()())))())())(((())

output:

0

result:

ok single line: '0'

Test #7:

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

input:

24
))(((xx)((((())xx((()()(

output:

0

result:

ok single line: '0'

Test #8:

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

input:

100
(()))(()))((((())))(()))))(()(x()((((((())))((())())))((()))((())(()((()(()((((()()(x)x)()))((((()((

output:

0

result:

ok single line: '0'

Test #9:

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

input:

100
)))))((()x))))())((())))(()))((()()()))())()))()))()(x((())(((())(()(()()((((()))))())(((((()))())()

output:

3

result:

ok single line: '3'

Test #10:

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

input:

100
))(()((x(()())x((()()(()))()))()))((()((())x)(((()()))()))(()))))(()(((((((()))())x()((((())(((()(()

output:

0

result:

ok single line: '0'

Test #11:

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

input:

24
(((x)(x)((()((x))()())))

output:

8

result:

ok single line: '8'

Test #12:

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

input:

78
()((()(((((((((((()()()())((()))((())((())())()()))((())(())))(()))()))))))))x

output:

2

result:

ok single line: '2'

Test #13:

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

input:

70
((((((()()))((())()(()((x))(((())(())()((())()((())))))(x)))(()x)))))x

output:

14

result:

ok single line: '14'

Test #14:

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

input:

52
(((()()()()x)(()))((((x)()(((((((())(((())xx))))))))

output:

16

result:

ok single line: '16'

Test #15:

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

input:

100
(())()()(()())(((((((((((((()((((())())((()(()()((())())))(()()))()(())(((((())())))))))))))))))))))

output:

1

result:

ok single line: '1'

Test #16:

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

input:

100
(()(())(())((((()(((((())(()((((()()()()()(())))x))()())()))((((())()((()())())((()()(()))))))))))))

output:

2

result:

ok single line: '2'

Test #17:

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

input:

100
()()xx()()()(()())()()()(())((x())((()()(())())((())())(()(()(())(())()(()())(x(()))))()()(((()())))

output:

13

result:

ok single line: '13'

Subtask #2:

score: 8
Accepted

Dependency #1:

100%
Accepted

Test #18:

score: 8
Accepted
time: 3ms
memory: 16828kb

input:

48
))()())())))(()((xx(())(x((((x(())(())((x((x))()

output:

7

result:

ok single line: '7'

Test #19:

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

input:

96
x)))))(()))))((())()())x)))((x((())())))())))))(()())(()())(())((x)x)))()(x(()((()(()))x(x())(()

output:

0

result:

ok single line: '0'

Test #20:

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

input:

28
)x)xxxx))()(())(((x()xx)xxxx

output:

1621

result:

ok single line: '1621'

Test #21:

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

input:

86
(()xx())())(xx)(x(x))((((x())((xx(x((()))x(())(x)(()(((())())(()(()(((()((())))((())((

output:

0

result:

ok single line: '0'

Test #22:

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

input:

100
(((((())(()(x))())(((()(()()((()))))x()(())(())(x))(x))x)x)((((())x)x))))()((x(()((()(((x()()(((x()x

output:

4096

result:

ok single line: '4096'

Test #23:

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

input:

100
)(())()x(()x))))))x)(()(x(((()((()()))))(())()()(()())x(x(((()(((()((()(((x))((()))))(()((((x)))x)()

output:

0

result:

ok single line: '0'

Test #24:

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

input:

100
x)()(()()x()))(()(()))()))((x))(())()(x)x)))())))())((()())x))((()()()(()(x()))x(xx))(((x))(x()()(()

output:

114

result:

ok single line: '114'

Test #25:

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

input:

78
(())()((())x(x(x))((x)(()(()((x())()x))()))(())())))()x(((((())))))(()()))()()

output:

128

result:

ok single line: '128'

Test #26:

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

input:

46
()(()x((xx()x(()(()(()(())())x(()x(x((x)x)))x)

output:

1023

result:

ok single line: '1023'

Test #27:

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

input:

82
(())(x)())()()((((((()()((()((()()()xx(((x))))(())x)()))(x)x(x()()())()x(x()x))))x

output:

2304

result:

ok single line: '2304'

Test #28:

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

input:

22
((xxx)xx((xx(xxx)))x)x

output:

2720

result:

ok single line: '2720'

Test #29:

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

input:

100
(()((((())(x)(()()()()))()(())()))()((()()(()(((((x)xxx)x)(((x)))x()(()(x()(()()()))))()(((())))))))

output:

512

result:

ok single line: '512'

Test #30:

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

input:

100
((()()()())(()()(((()())(xx(())x))))))()()()()(()x()(()(((()))(()())))()(()())()()((())((xx())(())x)

output:

128

result:

ok single line: '128'

Test #31:

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

input:

100
()()((())((()(()()))))()()()()(()x()((xxx)())(x))()(()x)()()((())((x()(x)x)())((()x()())(())x)x(()))

output:

4096

result:

ok single line: '4096'

Subtask #3:

score: 18
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #32:

score: 18
Accepted
time: 4ms
memory: 9152kb

input:

18
xx(xxxxxxxxxx)xxxx

output:

33999

result:

ok single line: '33999'

Test #33:

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

input:

20
xxx()x(x(xxxxx)(xxxx

output:

8324

result:

ok single line: '8324'

Test #34:

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

input:

34
xx)x((xxx(xxxx()x(xx)xx(xxxx()x)()

output:

533461

result:

ok single line: '533461'

Test #35:

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

input:

16
xxxxxxxxxxxxxxxx

output:

35708

result:

ok single line: '35708'

Test #36:

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

input:

100
))))()))x((()(x)(((xx(()x())(x(x)()x)()x)(()()x((x)()((((()))(x()()((())(x(())x))))((()())(()))((xx)

output:

5861

result:

ok single line: '5861'

Test #37:

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

input:

100
(())())))(()(()((xx)(x()))(((((())(())(()(()((x())))()xx()))(x(x((()))()(x)))x)())((xx)(xxx()xx)()x)

output:

141184

result:

ok single line: '141184'

Test #38:

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

input:

100
(()()x(((()(())))x(xx))((()(xx)()x(())x)(x)x()(xx)()))(())x)x()()x()x)(()()xx)(())(()(())(()xx)(())(

output:

65704

result:

ok single line: '65704'

Test #39:

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

input:

16
xxxxxxxxxxxxxxxx

output:

35708

result:

ok single line: '35708'

Test #40:

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

input:

86
(()()x)())(x)()()(xx)x(())x((x)x(x(()(x)(x()())(xx)(()((((xxx)x())x()()))))x))))(x()))

output:

1014061

result:

ok single line: '1014061'

Test #41:

score: 0
Accepted
time: 9ms
memory: 33356kb

input:

82
(((((()(())xx))(((x)((())x(x())x)(()(((x()x)(((xx)()()xx)xx(x))xx()x(())()))))x))x

output:

690240

result:

ok single line: '690240'

Test #42:

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

input:

96
(()()xx)x)x)(()()((xx(xx()))))x())(()((x(()x))())(x()))(())x()(((x)((x(()())())(x()(())()(xxx))x

output:

462358

result:

ok single line: '462358'

Test #43:

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

input:

100
((()(x))x((((((()())()x))x(x(x(())))()x)x(())()((()x()x(())x))))()))x(x))())((((x()((xxx(((x))))))x)

output:

483680

result:

ok single line: '483680'

Test #44:

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

input:

100
()x(()))((()))()(((((x)()()xx()))(((x((x)((x()))x((((()((x(()((x)x()((()((x((x()))()x)())())x))))x))

output:

33090

result:

ok single line: '33090'

Test #45:

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

input:

100
(((()((()x))()))(x((x)x((()(x((x))))x)x))))x()((()))(((((()())(xx)((x)))()()((()(x)(x(x))x)x()))xx)x

output:

593205

result:

ok single line: '593205'

Subtask #4:

score: 43
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #46:

score: 43
Accepted
time: 3ms
memory: 7484kb

input:

2
xx

output:

4

result:

ok single line: '4'

Test #47:

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

input:

100
()((())()())(())()(()(()((()(()(()((()))())((()()))((()()()))))()(()(()((()((())))((())()(()))))))))

output:

1

result:

ok single line: '1'

Test #48:

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

input:

45
xxxxxxxxxx((x(x(xx((xxxxxxx(xx(xx(xxx)x(xxxxx

output:

0

result:

ok single line: '0'

Test #49:

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

input:

96
)xx)(()(xx(x)())x)x)x((xx)xxx()((x)x)x)x((x))x(((()))xxx(()xx(xxx)((()()(x(x()())xx)x)(xx(x()x()

output:

77848412

result:

ok single line: '77848412'

Test #50:

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

input:

60
xxxxxxx)xx(xxxxxx)xxxxx(xxxx(xx)x)xxxx)xxxxx(x(x(xx()xxx(xxx

output:

988515207

result:

ok single line: '988515207'

Test #51:

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

input:

22
xxxxxxxxxxxxxxxxxxxxxx

output:

1955570

result:

ok single line: '1955570'

Test #52:

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

input:

82
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

output:

598801371

result:

ok single line: '598801371'

Test #53:

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

input:

100
xxxx(x)x(x)x(xx))(x)xxxx(xxxx)(x(x(xx)x)(x()(x))(())xxxx)())(xxx((x()((xx()x((((xxxxxxx)xxxx)(x(xx))

output:

407359237

result:

ok single line: '407359237'

Test #54:

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

input:

100
xxxxxxxxx)x(xxxxx)xxxxxxx)x)xxx)x())xxxx(x(((xxxxxx(x((()xx)xx()xxxx))xxxxxxxx(xx(xx()x(x()xxxxx(x)x

output:

305743173

result:

ok single line: '305743173'

Test #55:

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

input:

100
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

output:

685691690

result:

ok single line: '685691690'

Test #56:

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

input:

44
(x)x)x(xxx)(())(()(()xxxx(xxxxxxx()()xxx((x)

output:

1141552

result:

ok single line: '1141552'

Test #57:

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

input:

36
xxxxx(xxxx(x)x(xxxxx(xxxxx)xxxx)xxxx

output:

200422525

result:

ok single line: '200422525'

Test #58:

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

input:

36
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

output:

543075284

result:

ok single line: '543075284'

Test #59:

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

input:

70
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

output:

286582712

result:

ok single line: '286582712'

Test #60:

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

input:

100
((xxxxxx)(xx(x(x(x((xx)xx((xxxx)xxxxx)x((xx)))((x)()x(xx)x((()()(xxxxx)(x)(x)xxx()(()xx)x))xx))xxxxx

output:

711075853

result:

ok single line: '711075853'

Test #61:

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

input:

100
()()((x)x())xxxxxx((xx()(xx)))xx)(()x()x(x)xx())((()(((x)x)x(x()(x))xx((xx(x()()()())))xx))x))x))))x

output:

819964975

result:

ok single line: '819964975'

Subtask #5:

score: 27
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #62:

score: 27
Accepted
time: 157ms
memory: 196604kb

input:

226
xxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxx(xxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(xxxxxxxxxxxxxxxxxxxxxxx

output:

311662824

result:

ok single line: '311662824'

Test #63:

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

input:

222
x)())((xxx()x))x(x))x(xx(((xx)(x(((xxxx(x))x(x(xxx((xxx()xxxxxxxx))x(()()xxxxxxxx()x(xx)xxxxxx)(x(x(xxx(x))()((xx)(xxxx(xxxxx)xx(x())xx(x((xx)x)()xxx()xxxxx((x(((xxxxxxx(())x)xxxxxxx(xx()())xxxxx(xxxx())x())xxx(x())xx)x((x

output:

617635509

result:

ok single line: '617635509'

Test #64:

score: 0
Accepted
time: 60ms
memory: 100760kb

input:

158
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

output:

716446269

result:

ok single line: '716446269'

Test #65:

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

input:

134
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

output:

963748902

result:

ok single line: '963748902'

Test #66:

score: 0
Accepted
time: 317ms
memory: 338528kb

input:

300
xxxxxxxx)xx))xxxxx)xx(xx(xxx)xxxxx))xx))xx(xxxxx)xxx(xxxxxxxxxxx)xxxxxxxxxxx)xxxxxxx(xx(x)xxxx)xxxx)x)x)(x)x(x)))(xx(x(xx)xxxxxx)(xxxx(xxxxxx)xxxxxx)xxxxxxx(xxx)(x(xxx((x()xxxxxxxxxxx)xxxxxxxxx)xx(x(xxxxxxxx)xxxxxxxxxxxx)xxxx(xx()xxxxx)x(xxxxxxxxxx)xxxx(xxxxx()xxx)xxx)xxxxxxxxxxxx)xxxx)xxxxxxxxx...

output:

380753516

result:

ok single line: '380753516'

Test #67:

score: 0
Accepted
time: 273ms
memory: 338984kb

input:

300
)x)))x)x)x))xx)()()(x(xxx)x)(()x())(x()x((x)(())()x)xx)(xxxx))x)(x)x)x(((()(()))((()(x)()((xxx)(x)xxx)(x(())(()))())(())x()x)xx())x)(x)(xxx(x))((x)(((x)((()x()x))()x)))x)x))()()x((x)(((x(x))(((x)xx)))))(x)xx)x(x(((xxx)x(((xxx))x)xx()))x((xx()x)((x)(x(()xx)xx)))())))x((x(xx)x)x)((x)()()(xx()(x((x...

output:

674716216

result:

ok single line: '674716216'

Test #68:

score: 0
Accepted
time: 372ms
memory: 338924kb

input:

300
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

511488504

result:

ok single line: '511488504'

Test #69:

score: 0
Accepted
time: 51ms
memory: 110160kb

input:

166
((((()()))(())()()()(x))()x())(x((()x)(()x)((())())(x)()(xxx(())x(()()))((())(((x)x()((x)(x())((x()x)))(()xx)x)()()(xx((x())))())())xx()()()(())(())()((((x)()x(x)))x)

output:

254137024

result:

ok single line: '254137024'

Test #70:

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

input:

190
(x()()(((((())((()x()(x))((())(((())((()()(((()x())))((((((x))xx()x))())x()()))x()))()(x(x)((x)))(((())x)((((x())xx)x))x)x(x(x)())())((x((())x((()()))()(()))x)((((()))))(())(x))()))))x))))x)

output:

268435456

result:

ok single line: '268435456'

Test #71:

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

input:

116
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

output:

369003267

result:

ok single line: '369003267'

Test #72:

score: 0
Accepted
time: 42ms
memory: 77056kb

input:

136
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

output:

339830910

result:

ok single line: '339830910'

Test #73:

score: 0
Accepted
time: 333ms
memory: 338836kb

input:

300
(xx)xxx(x)(xxx)x)xxxxxxxxx(xxxx)((x(xx)xxxx((x(xxxx)xxxxxxxxx)xxx))xxxx)xxxxxxxx()xxxxxxxxxxxxxxxxxxxxx)xxxxxxxxxxxxxxx)xxxxxxx(xxxxxxxxx)xxxxxx)xxx((((xx)xxxx)xxxxxx(xxxxx)x()xx((xxxxxxxx)xxx)xxxxxxx(xxxxxxxxx)xx(xxxxxxxx)x)xxxxxx(xxxxxxxxxxxxxxx(xxxx)xx)xx)xxxx)xxxxxxxxxxxxxx)xxxxx)xxx)xxx)x)x...

output:

199242412

result:

ok single line: '199242412'

Test #74:

score: 0
Accepted
time: 281ms
memory: 342932kb

input:

300
(x(((()()()())(())((xx)))x((((()())()((x)((((((()))(()())())()())()))(((()((x((()x))((()())())(())()(xx))))()(((()()(()())()(x)x))x)())x(())())(x(()x())()())()))()))(())(((()(()()()(x()x)))(()(())))))))(x()()x)()()(((((()(()))(x)((()()()()))()(())))())()()()()((()))(())()(x(())x((())))()((())()(...

output:

3858728

result:

ok single line: '3858728'

Extra Test:

score: 0
Extra Test Passed