結果
問題 | No.2891 Mint |
ユーザー |
![]() |
提出日時 | 2024-09-13 22:20:17 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 465 ms / 2,000 ms |
コード長 | 455 bytes |
コンパイル時間 | 436 ms |
コンパイル使用メモリ | 82,788 KB |
実行使用メモリ | 277,328 KB |
最終ジャッジ日時 | 2024-09-13 22:20:45 |
合計ジャッジ時間 | 14,182 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 54 |
ソースコード
def Inverse_Proportion(N):retu=[]for i in range(1,N+1):if i==N or N//i>N//(i+1):retu.append(((i,i+1),N//i))else:for j in range(N//i,0,-1):retu.append(((N//(j+1)+1,N//j+1),j))breakreturn retuN,M=map(int,input().split())mod=998244353ans=N*Mfor (l,r),x in Inverse_Proportion(M):l=min(l,N+1)r=min(r,N+1)ans-=x*(l+r-1)*(r-l)//2ans%=modprint(ans)