結果

問題 No.3284 Picnic with Friends
ユーザー hirayuu_yc
提出日時 2025-09-23 10:47:48
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 629 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 82,424 KB
実行使用メモリ 166,864 KB
最終ジャッジ日時 2025-09-26 20:52:33
合計ジャッジ時間 12,368 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import isqrt
B=500000

def enum_quot(n):
    x=isqrt(n)
    ret=list(range(1,x+1))
    for i in range(x,0,-1):
        if ret[-1]!=n//i:
            ret.append(n//i)
    return ret
        

N=int(input())
S=list(map(int,input().split()))
Q=int(input())
event=[tuple(map(int,input().split())) for i in range(Q)]
event.sort()
A=[]
now=0
end=0
for t,f in event:
    if now==0:
        end=f+t
        now=f
    else:
        if t<=end:
            end+=f
            now+=f
        else:
            A.append(now)
            end=f+t
            now=f
A.append(now)
for s in S:
	ans=0
	for a in A:
		ans+=a//s
	print(ans)
0