結果

問題 No.188 HAPPY DAY
ユーザー ondy_candy
提出日時 2016-08-02 03:09:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 433 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-31 00:59:55
合計ジャッジ時間 590 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def is_date(year, month, day):
    try:
        datetime.date(year, month, day)
        return True
    except ValueError:
        return False

result = 0
# 1 - 12
for x in range(1,13):
    # 0 - 3
    for a in range(4):
        b = x - a
        if b < 0 or 9 < b:
            continue
        y = int(str(a) + str(b))
        if is_date(2015, x, y):
            result += 1

print(result)
0