結果
| 問題 | No.1158 GCD Products easy |
| ユーザー |
forest3
|
| 提出日時 | 2026-11-12 14:34:28 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 8 ms / 2,000 ms |
| + 268µs | |
| コード長 | 515 bytes |
| 記録 | |
| コンパイル時間 | 1,126 ms |
| コンパイル使用メモリ | 187,420 KB |
| 実行使用メモリ | 9,924 KB |
| 最終ジャッジ日時 | 2026-11-12 14:34:32 |
| 合計ジャッジ時間 | 2,869 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
using ll = unsigned long long;
int main(){
int a, b, n;
cin >> a >> b >> n;
ll mod = 1e9 + 7;
ll ans = 1;
function<void(int, int)> f = [&](int j, int g) {
if(j == n) {
ans = ans * g %mod;
return;
}
rep(i, a, b + 1) {
if(j == 0) f(j + 1, i);
else f(j + 1, __gcd(i, g));
}
};
f(0, 0);
cout << ans << endl;
}
forest3