結果

問題 No.1771 A DELETEQ
ユーザー XDXD
提出日時 2021-12-15 16:33:01
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 222 ms / 3,500 ms
コード長 529 bytes
コンパイル時間 1,572 ms
コンパイル使用メモリ 164,672 KB
実行使用メモリ 66,112 KB
最終ジャッジ日時 2023-10-01 02:29:54
合計ジャッジ時間 13,632 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 222 ms
66,112 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 221 ms
66,080 KB
testcase_05 AC 220 ms
65,848 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 15 ms
59,168 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 40 ms
15,220 KB
testcase_10 AC 33 ms
35,152 KB
testcase_11 AC 23 ms
17,080 KB
testcase_12 AC 21 ms
22,768 KB
testcase_13 AC 30 ms
37,828 KB
testcase_14 AC 82 ms
33,712 KB
testcase_15 AC 109 ms
36,036 KB
testcase_16 AC 111 ms
46,592 KB
testcase_17 AC 15 ms
37,644 KB
testcase_18 AC 38 ms
14,528 KB
testcase_19 AC 5 ms
4,480 KB
testcase_20 AC 71 ms
48,096 KB
testcase_21 AC 15 ms
30,296 KB
testcase_22 AC 26 ms
18,612 KB
testcase_23 AC 38 ms
34,764 KB
testcase_24 AC 10 ms
10,908 KB
testcase_25 AC 6 ms
8,512 KB
testcase_26 AC 68 ms
24,516 KB
testcase_27 AC 22 ms
12,576 KB
testcase_28 AC 7 ms
8,748 KB
evil_hand_1.txt RE -
evil_hand_2.txt RE -
evil_hand_3.txt RE -
evil_random_1.txt RE -
evil_random_2.txt TLE -
evil_random_3.txt RE -
evil_random_4.txt RE -
evil_random_5.txt RE -
evil_random_6.txt RE -
evil_random_7.txt RE -
evil_random_8.txt RE -
evil_random_9.txt RE -
権限があれば一括ダウンロードができます

ソースコード

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, m) 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