結果

問題 No.530 年齢って毎年変わるし覚えるの難しいよね
ユーザー @abcde@abcde
提出日時 2019-02-14 23:43:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 8,876 KB
最終ジャッジ日時 2023-10-11 12:49:02
合計ジャッジ時間 3,376 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,696 KB
testcase_01 AC 18 ms
8,700 KB
testcase_02 AC 18 ms
8,728 KB
testcase_03 AC 18 ms
8,812 KB
testcase_04 AC 18 ms
8,832 KB
testcase_05 AC 17 ms
8,696 KB
testcase_06 AC 18 ms
8,816 KB
testcase_07 AC 18 ms
8,748 KB
testcase_08 AC 18 ms
8,872 KB
testcase_09 AC 18 ms
8,648 KB
testcase_10 AC 19 ms
8,740 KB
testcase_11 AC 18 ms
8,684 KB
testcase_12 AC 18 ms
8,832 KB
testcase_13 AC 18 ms
8,684 KB
testcase_14 AC 18 ms
8,864 KB
testcase_15 AC 19 ms
8,644 KB
testcase_16 AC 18 ms
8,784 KB
testcase_17 AC 18 ms
8,812 KB
testcase_18 AC 18 ms
8,876 KB
testcase_19 AC 18 ms
8,804 KB
testcase_20 AC 18 ms
8,696 KB
testcase_21 AC 18 ms
8,804 KB
testcase_22 AC 19 ms
8,748 KB
testcase_23 AC 18 ms
8,700 KB
testcase_24 AC 19 ms
8,804 KB
testcase_25 AC 18 ms
8,724 KB
testcase_26 AC 18 ms
8,808 KB
testcase_27 AC 18 ms
8,780 KB
testcase_28 AC 18 ms
8,820 KB
testcase_29 AC 18 ms
8,716 KB
testcase_30 AC 19 ms
8,848 KB
testcase_31 AC 18 ms
8,668 KB
testcase_32 AC 19 ms
8,732 KB
testcase_33 AC 18 ms
8,836 KB
testcase_34 AC 18 ms
8,700 KB
testcase_35 AC 19 ms
8,712 KB
testcase_36 AC 18 ms
8,692 KB
testcase_37 AC 18 ms
8,780 KB
testcase_38 AC 18 ms
8,748 KB
testcase_39 AC 18 ms
8,816 KB
testcase_40 AC 19 ms
8,780 KB
testcase_41 AC 18 ms
8,696 KB
testcase_42 AC 19 ms
8,788 KB
testcase_43 AC 18 ms
8,836 KB
testcase_44 AC 18 ms
8,732 KB
testcase_45 AC 18 ms
8,696 KB
testcase_46 AC 18 ms
8,844 KB
testcase_47 AC 19 ms
8,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
from datetime import datetime

# 1. 入力情報取得.
Y = int(input())

# 2. 年齢は?
# Pythonic difference between two dates in years?
# https://stackoverflow.com/questions/4436957/pythonic-difference-between-two-dates-in-years
date2 = datetime(2017, 6, 23, 0, 0)
date1 = datetime(Y, 1, 1, 0, 0)
delta = date2 - date1
ans = int((delta.days + delta.seconds/86400)/365.2425)

# 3. 出力.
print(ans)
0