結果

問題 No.3389 k-Days Later
コンテスト
ユーザー Kude
提出日時 2025-11-28 21:29:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 609 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 82,052 KB
実行使用メモリ 91,064 KB
最終ジャッジ日時 2025-11-28 21:30:16
合計ジャッジ時間 20,941 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from itertools import accumulate
from bisect import bisect_right
n = int(input())
s = list(accumulate(map(int, input().split()), initial=0))
for _ in range(int(input())):
    y, m, d, k = map(int, input().split())
    m -= 1
    d -= 1
    v = s[-1] * y + s[m] + d + k
    y, v = divmod(v, s[-1])
    m = bisect_right(s, v) - 1
    d = v - s[m]
    print(y, m + 1, d + 1)
0