結果

問題 No.786 京都大学の過去問
ユーザー tanimani364tanimani364
提出日時 2021-03-23 18:11:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 1,076 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 80,228 KB
最終ジャッジ日時 2023-08-16 19:48:50
合計ジャッジ時間 2,025 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
80,140 KB
testcase_01 AC 127 ms
80,228 KB
testcase_02 AC 129 ms
80,080 KB
testcase_03 AC 127 ms
80,020 KB
testcase_04 AC 127 ms
80,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
#coding:utf-8

import math
import string
from sys import stdin
# import numpy as np
# from matplotlib import pyplot as plt

	
def main():
	read=stdin.readline

	#edit here!
	n=int(read())
	dp=[0]*(n+5)
	dp[0]=1
	for i in range(n):
		dp[i+1]+=dp[i]
		dp[i+2]+=dp[i]
	print(dp[n])
if __name__ == '__main__':
	main()
0