結果
| 問題 | No.3824 GCD of All |
| コンテスト | |
| ユーザー |
shiomusubi496
|
| 提出日時 | 2026-11-02 16:05:33 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 475 bytes |
| 記録 | |
| コンパイル時間 | 1,269 ms |
| コンパイル使用メモリ | 220,116 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-11-22 12:36:18 |
| 合計ジャッジ時間 | 7,507 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | -- * 25 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define all(v) begin(v), end(v)
using namespace std;
using ll = long long;
int main() {
ll M; cin >> M;
vector<ll> divs;
for (int i = 1; i <= M; ++i) if (M % i == 0) divs.push_back(i);
ll ans = 0;
for (int i = 1; i <= M; ++i) {
ans += *prev(upper_bound(all(divs), M / i));
}
cout << ans << endl;
}
shiomusubi496