結果

問題 No.3095 Many Min Problems
ユーザー kotatsugame
提出日時 2025-04-06 16:00:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 361 bytes
コンパイル時間 684 ms
コンパイル使用メモリ 65,408 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-06 16:00:49
合計ジャッジ時間 3,009 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cassert>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint998244353;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N,M;
	cin>>N>>M;
	mint ans=0;
	for(int v=1;v<=M;v++)
	{
		mint r=mint(M)/v;
		mint f=mint(v).pow(N);
		ans+=f*(r.val()==1?N:(r.pow(N)-1)/(r-1));
	}
	cout<<ans.val()<<endl;
}
0