結果
問題 | No.2940 Sigma Sigma Div Floor Problem |
ユーザー |
|
提出日時 | 2024-10-18 22:13:23 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 69 ms / 6,000 ms |
コード長 | 608 bytes |
コンパイル時間 | 1,998 ms |
コンパイル使用メモリ | 198,292 KB |
最終ジャッジ日時 | 2025-02-24 20:51:03 |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 29 WA * 1 |
ソースコード
#include <atcoder/math> #include <atcoder/modint> #include <bits/stdc++.h> using namespace std; using ll = long long; using mint = atcoder::modint998244353; #define rep(i, n) for (int i = 0; i < (int)(n); i++) void solve() { ll n; cin >> n; if (n > 10'000'000) return; mint ans = 0; for (ll j = 1; j <= n; j++) { ans += atcoder::floor_sum(n + 1, j, 1, 0); ans -= atcoder::floor_sum(j, j, 1, 0); } cout << ans.val() << '\n'; } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); int T = 1; for (int t = 0; t < T; t++) { solve(); } return 0; }