結果
| 問題 |
No.2940 Sigma Sigma Div Floor Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-19 11:30:02 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 6,000 ms |
| コード長 | 437 bytes |
| コンパイル時間 | 5,618 ms |
| コンパイル使用メモリ | 334,180 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-19 11:30:13 |
| 合計ジャッジ時間 | 7,213 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using ld=long double;
using ull=unsigned long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using mint=modint998244353;
const ll INF=1ll<<60;
int main(){
int N; cin>>N;
if(N>1200000)return 0;
mint ans=0;
for(int i=1;i<=N;i++){
ll a=N/i,b=N%i;
ans+=(a*(a-1)/2)*i+b*a+a;
}
cout<<ans.val()<<endl;
}