結果
問題 | No.2940 Sigma Sigma Div Floor Problem |
ユーザー |
|
提出日時 | 2024-10-18 21:36:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 73 ms / 6,000 ms |
コード長 | 473 bytes |
コンパイル時間 | 4,209 ms |
コンパイル使用メモリ | 229,880 KB |
実行使用メモリ | 10,148 KB |
最終ジャッジ日時 | 2024-10-18 22:31:11 |
合計ジャッジ時間 | 145,987 ms |
ジャッジサーバーID (参考情報) |
judge / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 29 TLE * 20 |
ソースコード
#include<bits/stdc++.h> using namespace std; #include <atcoder/all> using mint = atcoder::modint998244353; #define int long long signed main() { int n; cin >> n; int ans = 0; for(int i = 1; i <= n; i++) { for(int j = 1; j <= n; j++) { int l = i*j, r = (i+1)*j-1; if(l > n) break; ans+=i*(min(n,r)-min(n,l-1)); //cout << i << ' ' << j << ' ' << ans << endl; ans%=998244353; } } ans%=998244353; cout << ans << endl; }