Submission #3401083


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
long long p=1e9+7;
long long n,k,dp[10001];
long long quickpow(long long a,long long b,long long n)
{
	if(b==0&&n>1) return 1;
	if(b==0&&n==1) return 0;
	if(b==1) return a%n;
	if(b%2==0)
	{
		long long t=quickpow(a,b/2,n);
		return t*t%n;
	}
	else
	{
		long long t=quickpow(a,b/2,n);
		t=t*t%n;
		return t*a%n;
	}
}

int main(){
    cin>>n>>k;
    dp[0]=1;
    for(int i=1;i<n;i++)
	{
		for(int j=i;j>0;j--)
			dp[j]=(dp[j+1]+dp[j-1])%p;
		dp[0]=dp[1];
	}
	cout<<dp[n-k]*quickpow(2,n-k-1,p)%p<<endl;
}

Submission Info

Submission Time
Task F - Solitaire
User luogu_bot3
Language C++ (GCC 5.4.1)
Score 0
Code Size 578 Byte
Status WA
Exec Time 32 ms
Memory 384 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 1200
Status
AC × 3
AC × 21
WA × 5
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt, 00_example_03.txt
All 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 1 ms 256 KB
00_example_02.txt AC 1 ms 256 KB
00_example_03.txt AC 32 ms 256 KB
01.txt AC 1 ms 256 KB
02.txt AC 10 ms 256 KB
03.txt WA 1 ms 256 KB
04.txt AC 2 ms 256 KB
05.txt WA 1 ms 256 KB
06.txt AC 1 ms 256 KB
07.txt AC 1 ms 256 KB
08.txt AC 1 ms 256 KB
09.txt AC 29 ms 256 KB
10.txt AC 1 ms 256 KB
11.txt WA 1 ms 256 KB
12.txt AC 28 ms 256 KB
13.txt AC 1 ms 256 KB
14.txt AC 32 ms 256 KB
15.txt AC 4 ms 256 KB
16.txt AC 32 ms 256 KB
17.txt AC 32 ms 256 KB
18.txt AC 32 ms 256 KB
19.txt AC 32 ms 256 KB
20.txt AC 32 ms 256 KB
21.txt WA 1 ms 256 KB
22.txt WA 32 ms 384 KB
23.txt AC 32 ms 256 KB