結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー bellangeldindonbellangeldindon
提出日時 2019-05-09 09:29:41
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 492 bytes
コンパイル時間 47 ms
コンパイル使用メモリ 6,672 KB
実行使用メモリ 6,020 KB
最終ジャッジ日時 2023-09-14 17:37:30
合計ジャッジ時間 1,317 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,896 KB
testcase_01 AC 11 ms
5,972 KB
testcase_02 AC 12 ms
5,936 KB
testcase_03 AC 11 ms
6,016 KB
testcase_04 AC 12 ms
6,000 KB
testcase_05 AC 11 ms
5,812 KB
testcase_06 AC 11 ms
5,936 KB
testcase_07 AC 11 ms
5,872 KB
testcase_08 AC 12 ms
6,012 KB
testcase_09 AC 12 ms
5,976 KB
testcase_10 AC 12 ms
5,868 KB
testcase_11 AC 11 ms
5,812 KB
testcase_12 AC 11 ms
5,828 KB
testcase_13 AC 12 ms
5,900 KB
testcase_14 AC 12 ms
6,004 KB
testcase_15 AC 12 ms
5,876 KB
testcase_16 AC 11 ms
5,952 KB
testcase_17 AC 12 ms
6,020 KB
testcase_18 AC 11 ms
5,940 KB
testcase_19 AC 11 ms
5,868 KB
testcase_20 AC 11 ms
5,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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
0