結果

問題 No.3364 Push_back Operation
コンテスト
ユーザー kotatsugame
提出日時 2025-11-17 22:33:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 715 ms
コンパイル使用メモリ 65,540 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-11-17 22:33:46
合計ジャッジ時間 5,564 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 53
権限があれば一括ダウンロードができます

ソースコード

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);
	long N;cin>>N;
	long L=1;
	mint ans=0;
	while(L<=N)
	{
		long q=N/L;
		long rL=N/q;
		if(mint(q).val()==1)ans+=rL-L+1;
		else ans+=mint(q).pow(L)*(mint(q).pow(rL-L+1)-1)/(q-1);
		L=rL+1;
	}
	cout<<ans.val()<<endl;
}
0