結果

問題 No.8115 What day of week is it in N days?
ユーザー friedrice
提出日時 2025-04-04 17:22:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 619 bytes
コンパイル時間 2,696 ms
コンパイル使用メモリ 82,128 KB
実行使用メモリ 53,536 KB
最終ジャッジ日時 2025-04-04 17:22:14
合計ジャッジ時間 2,610 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    # N を入力として受け取る
    N = int(input().strip())
    
    # 2025年のエイプリルフールは火曜日
    start_day = "Tuesday"
    
    # 曜日のリスト(順番が重要)
    weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
    
    # 火曜日はインデックス2なので、それからN日後の曜日を計算
    current_day_index = weekdays.index(start_day)  # 火曜日は2番目
    result_day_index = (current_day_index + (N % 7)) % 7
    
    # 結果となる曜日を出力
    print(weekdays[result_day_index])
solve()
0