Submission #1832892
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define ll long long const int N = 303; const int inf = (int)1e9 + 7; int dp[N][N][N]; int mult (int a, int b) { return (ll) a * b % inf; } int add (int a, int b) { a += b; if (a >= inf) a -= inf; } main() { int n, m; scanf ("%d %d", &n, &m); dp[0][1][1] = 1; for (int i = 0; i < m; i++) { for (int j = 1; j <= n; j++) { for (int l = 1; l <= n; l++) { int delta = dp[i][j][l]; if (delta == 0) continue; dp[i + 1][j + 1][l] = mult(delta, (n - j)); dp[i + 1][j][l] = mult(delta, j - l); dp[i + 1][j][j] = mult(delta, l); } } } cout << dp[m][n][n]; }
Submission Info
Submission Time | |
---|---|
Task | F - Road of the King |
User | vjudge4 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 753 Byte |
Status | WA |
Exec Time | 60 ms |
Memory | 106752 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:22:38: 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); ^
Judge Result
Set Name | sample | all | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 1000 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt, sample-03.txt |
all | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 1 ms | 256 KB |
01-02.txt | AC | 1 ms | 256 KB |
01-03.txt | WA | 22 ms | 106752 KB |
01-04.txt | AC | 1 ms | 256 KB |
01-05.txt | WA | 22 ms | 106752 KB |
01-06.txt | WA | 28 ms | 106752 KB |
01-07.txt | WA | 59 ms | 106752 KB |
01-08.txt | WA | 60 ms | 106752 KB |
01-09.txt | WA | 60 ms | 106752 KB |
01-10.txt | AC | 60 ms | 106752 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | WA | 37 ms | 106752 KB |
sample-03.txt | AC | 24 ms | 53504 KB |