Submission #3622321
Source Code Expand
#include <cstdio> using namespace std; typedef long long LL; const int N = 4010; const LL mod = 998244353; int n, m; LL C[N][N], pow[N]; void init() { C[0][0] = 1; for (int i = 1; i <= n + m; ++ i) { C[i][0] = 1; for (int j = 1; j <= i; ++ j) C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod; } pow[0] = 1; for (int i = 1; i <= m; ++ i) pow[i] = pow[i - 1] * 2 % mod; } LL calc(int k, int x, int y) { return C[k + y - 1][x + y - 1]; } int main() { scanf("%d %d", &m, &n); init(); for (int i = 2; i <= m << 1; ++ i) { LL ans = 0; int p = 0; for (int j = 1; j <= m; ++ j) { if (i - j <= j) break; p += 1 <= i - j && i - j <= m; } if (i & 1) { for (int q = 0; q <= p; ++ q) (ans += C[p][q] * pow[q] * calc(n, q, m - (p << 1))) %= mod; } else { for (int q = 0; q <= p; ++ q) { (ans += C[p][q] * pow[q] * calc(n, q, m - (p << 1) - 1)) %= mod; (ans += C[p][q] * pow[q] * calc(n - 1, q, m - (p << 1) - 1)) %= mod; } } printf("%lld\n", ans); } }
Submission Info
Submission Time | |
---|---|
Task | E - Stop. Otherwise... |
User | perfect_me |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1071 Byte |
Status | WA |
Exec Time | 53 ms |
Memory | 123776 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:30:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &m, &n); ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 700 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | 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, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | WA | 53 ms | 123776 KB |
02.txt | WA | 47 ms | 117248 KB |
03.txt | WA | 43 ms | 98816 KB |
04.txt | AC | 16 ms | 61824 KB |
05.txt | AC | 30 ms | 61952 KB |
06.txt | WA | 42 ms | 104960 KB |
07.txt | WA | 53 ms | 123776 KB |
08.txt | WA | 23 ms | 78336 KB |
09.txt | AC | 9 ms | 37376 KB |
10.txt | WA | 19 ms | 45568 KB |
11.txt | AC | 28 ms | 57856 KB |
12.txt | AC | 13 ms | 51584 KB |
13.txt | WA | 9 ms | 29184 KB |
14.txt | WA | 41 ms | 98816 KB |
15.txt | WA | 45 ms | 109056 KB |
16.txt | WA | 44 ms | 111104 KB |
17.txt | AC | 1 ms | 128 KB |
18.txt | AC | 1 ms | 128 KB |
19.txt | AC | 1 ms | 128 KB |
20.txt | AC | 1 ms | 128 KB |
s1.txt | AC | 1 ms | 128 KB |
s2.txt | AC | 1 ms | 256 KB |
s3.txt | AC | 7 ms | 31104 KB |