結果

問題 No.1771 A DELETEQ
ユーザー XDXD
提出日時 2021-12-15 16:31:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 529 bytes
コンパイル時間 1,883 ms
コンパイル使用メモリ 165,724 KB
実行使用メモリ 136,312 KB
最終ジャッジ日時 2023-10-01 02:29:40
合計ジャッジ時間 43,893 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,764 KB
testcase_01 AC 2 ms
70,136 KB
testcase_02 AC 220 ms
70,688 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 219 ms
66,120 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 85 ms
34,264 KB
testcase_11 WA -
testcase_12 AC 34 ms
17,252 KB
testcase_13 AC 95 ms
37,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 125 ms
48,084 KB
testcase_17 AC 84 ms
34,008 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 160 ms
55,828 KB
testcase_21 AC 57 ms
24,988 KB
testcase_22 WA -
testcase_23 AC 80 ms
32,816 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
evil_hand_1.txt TLE -
evil_hand_2.txt RE -
evil_hand_3.txt TLE -
evil_random_1.txt RE -
evil_random_2.txt RE -
evil_random_3.txt RE -
evil_random_4.txt TLE -
evil_random_5.txt RE -
evil_random_6.txt RE -
evil_random_7.txt TLE -
evil_random_8.txt TLE -
evil_random_9.txt TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define forn(i,s,t) for(int i = (s); i <= (t); ++i)
using namespace std;
const int N = 4004, Mod = 998244353;
int f[N][N], n, m;
int main() {
	scanf("%d%d", &n, &m);
	f[0][0] = 1;
	forn (i, 0, n) forn (j, 0, n) if (i != 0 || j != 0) {
		if (i) f[i][j] += f[i - 1][j];
		if (j) f[i][j] += f[i][j - 1];
		f[i][j] %= Mod;
		if (i && j) f[i][j] += 2ll * f[i - 1][j - 1] % Mod;
		f[i][j] %= Mod;
	}
	int res = 0;
	forn (i, 0, min(n, m)) res = (res + f[n - i][m - i]) % Mod;
	printf("%d\n", res);
	return 0;
}
0