結果

問題 No.3389 k-Days Later
コンテスト
ユーザー しゃとる
提出日時 2025-11-28 22:58:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 614 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 82,788 KB
実行使用メモリ 91,268 KB
最終ジャッジ日時 2025-11-28 22:59:22
合計ジャッジ時間 18,761 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def search(p):#借りにp=10とする
    global sumday
    if p%sumday == p:
        return 0
    left= 0
    right = p #わんちゃんp+1
    while left <= right:
        cnt = (right+left)//2
        if p//sumday < cnt:
            left = cnt+1
        elif p//sumday > cnt:
            right = cnt-1
        else:
            return cnt
    return cnt

n = int(input())
D = list(map(int,input().split()))
q = int(input())
sumday = sum(D)
for i in range(q):
    y,m,d,k = map(int,input().split())
    y += search(k)//sumday
    k -= int(search(k))
    m += search(k)//D[search(k)-1]
    d += k
    print(y,m,d)
0