結果

問題 No.721 Die tertia (ディエ・テルツィア)
コンテスト
ユーザー bellangeldindon
提出日時 2019-05-09 09:29:41
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 492 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 205 ms
コンパイル使用メモリ 77,452 KB
最終ジャッジ日時 2025-12-04 01:39:35
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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