結果

問題 No.1689 Set Cards
ユーザー 👑 ygussanyygussany
提出日時 2021-09-12 14:32:50
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 615 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 29,208 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-18 20:27:23
合計ジャッジ時間 1,317 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 6 ms
4,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 7 ms
4,376 KB
testcase_20 AC 7 ms
4,376 KB
testcase_21 AC 7 ms
4,380 KB
testcase_22 AC 6 ms
4,376 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

const int Mod = 998244353;
const int bit[13] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096};

int main()
{
	int i, j, k, l, N, C, cur, prev;
	long long dp[2][4096] = {};
	scanf("%d", &N);
	for (i = 1, dp[0][bit[12]-1] = 1, cur = 1, prev = 0; i <= N; i++, cur ^= 1, prev ^= 1) {
		scanf("%d", &k);
		for (j = 1, l = 0; j <= k; j++) {
			scanf("%d", &C);
			l |= bit[C-1];
		}
		for (k = 0; k < bit[12]; k++) {
			dp[prev][k] %= Mod;
			dp[cur][k] += dp[prev][k];
			dp[cur][k&l] += dp[prev][k];
			dp[prev][k] = 0;
		}
	}
	printf("%lld\n", dp[prev][0]);
	fflush(stdout);
	return 0;
}
0