結果

問題 No.2940 Sigma Sigma Div Floor Problem
コンテスト
ユーザー Unbakedbread
提出日時 2026-01-02 18:25:41
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
結果
AC  
実行時間 24 ms / 6,000 ms
コード長 358 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,224 ms
コンパイル使用メモリ 333,876 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-01-02 18:25:46
合計ジャッジ時間 4,834 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
constexpr int mod = 998244353;

int main(void) {
	ll N;
	cin >> N;
	
	if(N > 2e6) return 1;
	
	ll ans = 0;
	for(ll j = 1; j <= N; ++j) {
		ans = (ans +  (N / j) * (N / j - 1) / 2 * j % mod) % mod;
		ans = (ans + (N / j) * (N % j + 1) % mod) % mod;
	}
	
	cout << ans << "\n";
	
	return 0;
}
0