結果
問題 |
No.721 Die tertia (ディエ・テルツィア)
|
ユーザー |
![]() |
提出日時 | 2019-05-09 09:29:41 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 13 ms / 2,000 ms |
コード長 | 492 bytes |
コンパイル時間 | 110 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-07-02 00:44:10 |
合計ジャッジ時間 | 1,125 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
Y, M, D = map(int, raw_input().split('/')) calendar = [] small = [4, 6, 9, 11] for i in range(0, 12): if i == 2: if Y % 4 == 0 and (Y % 100 != 0 or Y % 400 == 0): calendar.append(29) else: calendar.append(28) elif i in small: calendar.append(30) else: calendar.append(31) D += 2 if D > calendar[M%12]: D -= calendar[M%12] M += 1 if M > 12: Y += 1 M -= 12 ans = str(Y) + '/' if M < 10: ans = ans + '0' ans = ans + str(M) + '/' if D < 10: ans = ans + '0' ans = ans + str(D) print ans