QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#643123#51. Tilingtest123100 ✓1ms3920kbC++14500b2024-10-15 19:01:442024-10-15 19:01:45

Judging History

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

  • [2024-10-15 19:01:45]
  • 评测
  • 测评结果:100
  • 用时:1ms
  • 内存:3920kb
  • [2024-10-15 19:01:44]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int maxn=1005;
const int mod=1000000007;
int read(){
	int ret=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-f;ch=getchar();}
	while( isdigit(ch)){ret=(ret<<3)+(ret<<1)+(ch&15);ch=getchar();}
	return ret*f; 
}
int n,ans;
int f[maxn];
int main(){
	n=read();
	f[0]=1;
	for(int i=1;i<=n;++i){
		if(i>=2) f[i]=f[i-2];
		for(int j=2;j<=i;j+=2){
			f[i]=(f[i]+2ll*f[i-j])%mod;
		}
	}
	printf("%d\n",f[n]);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests


Final Tests

Test #1:

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

input:

1

output:

0

result:

ok single line: '0'

Test #2:

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

input:

256

output:

554759730

result:

ok single line: '554759730'

Test #3:

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

input:

36

output:

558008386

result:

ok single line: '558008386'

Test #4:

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

input:

10

output:

571

result:

ok single line: '571'

Test #5:

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

input:

46

output:

976579640

result:

ok single line: '976579640'

Test #6:

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

input:

24

output:

5757961

result:

ok single line: '5757961'

Test #7:

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

input:

202

output:

32846672

result:

ok single line: '32846672'

Test #8:

score: 5
Accepted
time: 1ms
memory: 3824kb

input:

998

output:

947883368

result:

ok single line: '947883368'

Test #9:

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

input:

98

output:

124059936

result:

ok single line: '124059936'

Test #10:

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

input:

100

output:

436252889

result:

ok single line: '436252889'

Test #11:

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

input:

200

output:

938934822

result:

ok single line: '938934822'

Test #12:

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

input:

5

output:

0

result:

ok single line: '0'

Test #13:

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

input:

18

output:

110771

result:

ok single line: '110771'

Test #14:

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

input:

2

output:

3

result:

ok single line: '3'

Test #15:

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

input:

4

output:

11

result:

ok single line: '11'

Test #16:

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

input:

6

output:

41

result:

ok single line: '41'

Test #17:

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

input:

12

output:

2131

result:

ok single line: '2131'

Test #18:

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

input:

102

output:

620951613

result:

ok single line: '620951613'

Test #19:

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

input:

16

output:

29681

result:

ok single line: '29681'

Test #20:

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

input:

378

output:

234239121

result:

ok single line: '234239121'