結果

問題 No.786 京都大学の過去問
ユーザー StarMatyanStarMatyan
提出日時 2019-08-15 22:37:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 11,812 KB
実行使用メモリ 10,076 KB
最終ジャッジ日時 2023-10-19 19:29:04
合計ジャッジ時間 826 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,076 KB
testcase_01 AC 32 ms
10,076 KB
testcase_02 AC 30 ms
10,076 KB
testcase_03 AC 29 ms
10,076 KB
testcase_04 AC 29 ms
10,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

first = int(input())
result = 0
result_b = 0
kan =0

for num in range(first):
	if num ==0:
		kan = 1
	elif num ==1:
		kan = 2
		result = 2
		result_b =1
	elif num > 1:
		kan = result + result_b
		result_b = result
		result = kan

print(kan)
0