結果
| 問題 | 
                            No.1573 Divisor Function
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-07-09 19:55:25 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 5 ms / 2,000 ms | 
| コード長 | 361 bytes | 
| コンパイル時間 | 598 ms | 
| コンパイル使用メモリ | 66,316 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-01 14:06:01 | 
| 合計ジャッジ時間 | 1,788 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 43 | 
ソースコード
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 1e6+10,mod=998244353;
typedef long long LL;
int main(){
	LL n,m;
	LL ans=0;
	scanf("%lld%lld",&n,&m);
	for(LL i=1,j;i<=m;i=j+1){
		LL t=n/i;
		if(t==0)break;
		j=min(n/t,m);
		LL sum=(j-i+1)*(j+i)/2;
		ans+=sum*(t+t*(t+1)/2)%mod;
		ans%=mod;
	}
	cout<<ans;
	return 0;
}