結果
| 問題 | No.3416 マッチ棒パズル Extra |
| コンテスト | |
| ユーザー |
noya2
|
| 提出日時 | 2025-12-23 01:19:30 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 583 bytes |
| 記録 | |
| コンパイル時間 | 2,989 ms |
| コンパイル使用メモリ | 279,192 KB |
| 実行使用メモリ | 10,920 KB |
| 最終ジャッジ日時 | 2025-12-23 01:19:42 |
| 合計ジャッジ時間 | 11,731 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 25 |
ソースコード
#include<bits/stdc++.h>
#include<atcoder/modint>
using namespace std;
using mint = atcoder::modint998244353;
void solve(){
uint64_t n; cin >> n;
n = n * 2 + 1;
uint64_t m = sqrt(n);
while ((m+1)*(m+1) <= n) m++;
while (m*m > n) m--;
uint64_t sum = 0;
for (uint64_t i = 1; i <= m; i += 2){
sum += (n + i) / (i * 2);
}
mint ans = sum;
ans *= 2;
ans -= mint((m+1)/2).pow(2);
ans -= n;
cout << ans.val() << '\n';
}
int main(){
cin.tie(0)->sync_with_stdio(0);
int t; cin >> t;
while (t--){
solve();
}
}
noya2