結果

問題 No.1573 Divisor Function
ユーザー the-xin
提出日時 2021-07-09 19:54:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 344 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 67,336 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 14:05:55
合計ジャッジ時間 4,445 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 RE * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
		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;
}
0