Submission #57138

# Submission time Handle Problem Language Result Execution time Memory
57138 2018-07-14T06:30:42 Z kriii Tents (JOI18_tents) C++17
0 / 100
2 ms 504 KB
#include <stdio.h>

const long long mod = 1000000007;
long long d[3030][3030];

int main()
{
	int N,M; scanf ("%d %d",&N,&M);

	for (int i=0;i<=N;i++) for (int j=0;j<=M;j++){
		if (i == 0 || j == 0) d[i][j] = 1;
		else{
			d[i][j] = (d[i-1][j] + d[i-1][j-1] * j * 4) % mod;
			if (i >= 2) d[i][j] = (d[i][j] + d[i-2][j-1] * (i - 1) * j) % mod;
			if (j >= 2) d[i][j] = (d[i][j] + d[i-1][j-2] * j * (j - 1) / 2) % mod;
		}
	}

	printf ("%lld\n",d[N][M]);

	return 0;
}

Compilation message

tents.cpp: In function 'int main()':
tents.cpp:8:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  int N,M; scanf ("%d %d",&N,&M);
           ~~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -