結果
| 問題 | No.3389 k-Days Later |
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2025-11-28 21:38:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 621 ms / 2,000 ms |
| コード長 | 456 bytes |
| コンパイル時間 | 217 ms |
| コンパイル使用メモリ | 82,336 KB |
| 実行使用メモリ | 97,396 KB |
| 最終ジャッジ日時 | 2025-11-28 21:39:18 |
| 合計ジャッジ時間 | 21,755 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 28 |
ソースコード
#N,M,L=map(int, input().split())
N=int(input())
D=list(map(int, input().split()))
#B=list(map(int, input().split()))
#C=list(map(int, input().split()))
A=[0]
for d in D:
A.append(A[-1]+d)
su=A[-1]
Q=int(input())
import bisect
for i in range(Q):
y,m,d,k=map(int, input().split())
s=(y-1)*su+A[m-1]+d+k
B=[]
B.append(s//su+1)
s%=su
if s==0:
s+=su;B[-1]-=1
d=bisect.bisect_left(A,s)
B.append(d)
s-=A[d-1]
B.append(s)
print(*B)
timi