結果

問題 No.314 ケンケンパ
ユーザー 👑 tatt61880tatt61880
提出日時 2020-07-01 04:26:48
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 432 bytes
コンパイル時間 2,382 ms
コンパイル使用メモリ 151,120 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 16:56:11
合計ジャッジ時間 3,462 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 2 ms
4,352 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 4 ms
4,348 KB
testcase_17 AC 8 ms
4,348 KB
testcase_18 AC 28 ms
4,348 KB
testcase_19 AC 58 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	const mod: int :: 1000000007
	var n: int :: cui@inputInt()
	var dp: []int :: #[3]int
	do dp[2] :: 1
	for(1, n)
		var nx: []int :: #[3]int
		do nx[0] :: dp[2]
		do nx[1] :: dp[0]
		do nx[2] :: dp[0] + dp[1]
		for i(0, 2)
			do nx[i] :% mod
		end for
		var tmp: []int :: dp
		do dp :: nx
		do nx :: tmp
	end for
	var ans: int :: 0
	for i(0, 2)
		do ans :+ dp[i]
	end for
	do ans :% mod
	do cui@print("\{ans}\n")
end func
0