제출 #68616

#제출 시각아이디문제언어결과실행 시간메모리
68616TadijaSebezTents (JOI18_tents)C++11
0 / 100
2 ms376 KiB
#include <stdio.h>
#define ll long long
const int N=3005;
const int mod=1e9+7;
int dp[N][N];
int main()
{
	int n,m,i,j;
	scanf("%i %i",&n,&m);
	for(i=0;i<=n;i++)
	{
		for(j=0;j<=m;j++)
		{
			if(i==0 || j==0){ dp[i][j]=1;continue;}
			dp[i][j]=dp[i-1][j]+(ll)dp[i-1][j-1]*j%mod*4%mod;
			dp[i][j]%=mod;
			if(i>1) dp[i][j]+=(ll)dp[i-2][j-1]*j%mod*(i-1)%mod;
			dp[i][j]%=mod;
			if(j>1) dp[i][j]+=(ll)dp[i-1][j-2]*j%mod*(j-1)%mod*((mod-1)/2)%mod;
			dp[i][j]%=mod;
		}
	}
	printf("%i\n",(dp[n][m]+mod-1)%mod);
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

tents.cpp: In function 'int main()':
tents.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%i %i",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...