結果
| 問題 |
No.2462 七人カノン
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2023-09-16 00:26:48 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 525 ms / 2,000 ms |
| コード長 | 470 bytes |
| コンパイル時間 | 459 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 45,056 KB |
| 最終ジャッジ日時 | 2024-07-03 01:35:27 |
| 合計ジャッジ時間 | 13,261 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
import sys
input = sys.stdin.readline
N,Q=map(int,input().split())
Query=[list(map(int,input().split())) for i in range(Q)]
TIME=[0]*(10**5+1)
for i,s,t in Query:
TIME[s]+=1
TIME[t]-=1
for i in range(1,10**5+1):
TIME[i]+=TIME[i-1]
LIST=[0]
for i in range(10**5+1):
if TIME[i]!=0:
LIST.append(LIST[-1]+1/TIME[i])
else:
LIST.append(0)
ANS=[0]*N
for i,s,t in Query:
ANS[i-1]+=LIST[t]-LIST[s]
for ans in ANS:
print(ans)
titia