結果
| 問題 | No.786 京都大学の過去問 |
| コンテスト | |
| ユーザー |
r_ishida
|
| 提出日時 | 2026-02-02 03:56:48 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 2,000 ms |
| コード長 | 467 bytes |
| 記録 | |
| コンパイル時間 | 374 ms |
| コンパイル使用メモリ | 82,264 KB |
| 実行使用メモリ | 53,520 KB |
| 最終ジャッジ日時 | 2026-02-02 03:56:50 |
| 合計ジャッジ時間 | 1,476 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 |
ソースコード
import math
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
a = [1, 2]
if n == 1:
print(1)
elif n == 2:
print(2)
else:
for i in range(n-2):
a.append(a[-1] + a[-2])
print(a[-1])
r_ishida