| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38647 | Gapple | 【S】T2 | C++ | 解答错误 | 50 | 31 MS | 528 KB | 713 | 2025-10-18 14:35:02 |
#include <algorithm> #include <cmath> #include <iostream> using namespace std; using i64 = long long; constexpr int SQRT_DIFF = 31623, SQRT_EDGE = 54; int dist[SQRT_DIFF + 1]; void precalc() { dist[1] = 1; for (int i = 1; i <= SQRT_DIFF; ++i) { for (int j = 2; j <= SQRT_EDGE && i * j <= SQRT_DIFF; ++j) dist[i * j] = max(dist[i * j], dist[i] * int(pow(j, 8. / 7))); } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int q; cin >> q; precalc(); while (q-- > 0) { int x, y; cin >> x >> y; cout << dist[int(sqrt(y / x))] << '\n'; } return 0; }