結果
問題 |
No.2758 RDQ
|
ユーザー |
![]() |
提出日時 | 2024-09-21 16:54:23 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 368 bytes |
コンパイル時間 | 194 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 217,508 KB |
最終ジャッジ日時 | 2024-09-21 16:54:32 |
合計ジャッジ時間 | 8,543 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 6 TLE * 1 -- * 14 |
ソースコード
n,q=map(int,input().split()) a=list(map(int,input().split())) f=[] for i in range(n): v=a[i] j=1 while j*j<=v: if v%j==0: f+=[(j,i)] if v//j!=j: f+=[(v//j,i)] j+=1 f.sort() from bisect import bisect_left,bisect_right for _ in range(q): l,r,k=map(int,input().split()) l-=1 r-=1 print(bisect_right(f,(k,r))-bisect_left(f,(k,l)))