結果

問題 No.1573 Divisor Function
ユーザー the-xin
提出日時 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
権限があれば一括ダウンロードができます

ソースコード

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