結果

問題 No.1811 EQUIV Ten
ユーザー 👑 ygussanyygussany
提出日時 2021-12-29 14:55:03
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 545 bytes
コンパイル時間 855 ms
コンパイル使用メモリ 29,328 KB
実行使用メモリ 14,412 KB
最終ジャッジ日時 2023-08-12 16:49:39
合計ジャッジ時間 2,037 ms
ジャッジサーバーID
(参考情報)
judge2 / judge7
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
14,376 KB
testcase_01 AC 5 ms
14,328 KB
testcase_02 AC 5 ms
14,220 KB
testcase_03 AC 4 ms
14,284 KB
testcase_04 AC 5 ms
14,412 KB
testcase_05 AC 5 ms
14,220 KB
testcase_06 AC 6 ms
14,328 KB
testcase_07 AC 5 ms
14,288 KB
testcase_08 AC 5 ms
14,340 KB
testcase_09 AC 5 ms
14,324 KB
testcase_10 AC 5 ms
14,348 KB
testcase_11 AC 19 ms
14,400 KB
testcase_12 AC 21 ms
14,260 KB
testcase_13 AC 22 ms
14,324 KB
testcase_14 AC 23 ms
14,224 KB
testcase_15 AC 23 ms
14,228 KB
testcase_16 AC 5 ms
14,412 KB
testcase_17 AC 5 ms
14,224 KB
testcase_18 AC 5 ms
14,224 KB
testcase_19 AC 5 ms
14,264 KB
testcase_20 AC 6 ms
14,332 KB
testcase_21 AC 5 ms
14,348 KB
testcase_22 AC 4 ms
14,288 KB
testcase_23 AC 11 ms
14,284 KB
testcase_24 AC 6 ms
14,224 KB
testcase_25 AC 5 ms
14,340 KB
testcase_26 AC 10 ms
14,264 KB
testcase_27 AC 5 ms
14,352 KB
testcase_28 AC 5 ms
14,336 KB
testcase_29 AC 5 ms
14,412 KB
testcase_30 AC 20 ms
14,352 KB
testcase_31 AC 6 ms
14,324 KB
testcase_32 AC 5 ms
14,340 KB
testcase_33 AC 7 ms
14,284 KB
testcase_34 AC 18 ms
14,328 KB
testcase_35 AC 10 ms
14,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

const int Mod = 1000000007;

int main()
{
	int N;
	scanf("%d", &N);
	
	int i, j, dp[200001][16] = {};
	long long ans = 0, tmp;
	for (i = 5, dp[4][10] = 1; i <= N; i++) {
		for (j = 0; j < 16; j++) {
			dp[i][j*2%16] += dp[i-1][j];
			dp[i][(j*2+1)%16] += dp[i-1][j];
		}
		dp[i][10] = 0;
		for (j = 0; j < 16; j++) if (dp[i][j] >= Mod) dp[i][j] -= Mod;
	}
	for (i = N, tmp = 1; i >= 1; i--, tmp = tmp * 2 % Mod) for (j = 0; j < 16; j++) ans += tmp * dp[i][j] % Mod;
	printf("%lld\n", ans % Mod);
	fflush(stdout);
	return 0;
}
0