結果

問題 No.2462 七人カノン
ユーザー sasa8uyauyasasa8uyauya
提出日時 2023-09-08 21:50:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 766 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 97,240 KB
最終ジャッジ日時 2023-09-08 21:50:17
合計ジャッジ時間 11,595 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
77,660 KB
testcase_01 AC 85 ms
77,860 KB
testcase_02 AC 82 ms
77,796 KB
testcase_03 AC 98 ms
77,988 KB
testcase_04 AC 91 ms
78,132 KB
testcase_05 AC 93 ms
78,144 KB
testcase_06 AC 94 ms
78,240 KB
testcase_07 AC 91 ms
78,188 KB
testcase_08 AC 92 ms
78,140 KB
testcase_09 AC 90 ms
78,068 KB
testcase_10 AC 95 ms
78,060 KB
testcase_11 AC 94 ms
77,980 KB
testcase_12 AC 92 ms
77,996 KB
testcase_13 AC 295 ms
94,672 KB
testcase_14 AC 280 ms
95,512 KB
testcase_15 AC 269 ms
93,864 KB
testcase_16 AC 294 ms
97,180 KB
testcase_17 AC 296 ms
97,156 KB
testcase_18 AC 100 ms
82,604 KB
testcase_19 AC 101 ms
82,476 KB
testcase_20 AC 308 ms
96,612 KB
testcase_21 AC 305 ms
96,636 KB
testcase_22 AC 307 ms
96,660 KB
testcase_23 AC 307 ms
96,716 KB
testcase_24 AC 234 ms
90,984 KB
testcase_25 AC 319 ms
97,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q=map(int,input().split())
m=100000
a=[]
g=[0]*(m+2)
for i in range(q):
	p,s,t=map(int,input().split())
	p-=1
	a.append((p,s,t))
	g[s]+=1
	g[t]-=1
for i in range(m+1):
	g[i]+=g[i-1]
for i in range(m+1):
	if g[i]>0:
		g[i]=1/g[i]
for i in range(m+1):
	g[i]+=g[i-1]
f=[0]*n
for p,s,t in a:
	f[p]+=g[t-1]-g[s-1]
print(*f,sep="\n")
0