| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38595 | Gapple | 【S】T2 | C++ | 运行超时 | 50 | 1000 MS | 228 KB | 1069 | 2025-10-18 13:17:19 |
#include <functional> #pragma GCC optimize("Ofast,no-stack-protector") #include <algorithm> #include <cmath> #include <cstdio> using namespace std; using i64 = long long; constexpr int SQRT_EDGE = 54, MAX_EDGE = 3000; int main() { int q; scanf("%d", &q); int power[MAX_EDGE + 1]; for (int i = 1; i <= MAX_EDGE; ++i) power[i] = pow(i, 8.0 / 7); while (q-- > 0) { i64 x, y; scanf("%lld %lld", &x, &y); int ans = 1; function<void(i64, int, int)> dfs = [&](i64 cur, int len, int step) -> void { if (cur > y) return; else if (cur * MAX_EDGE >= y) { ans = max(ans, len * power[int(sqrt(double(y) / cur))]); return; } else if (step == 0) return; for (int i = 2; i <= SQRT_EDGE && cur * i * i <= y; ++i) dfs(cur * i * i, len * power[i], step - 1); }; dfs(x, 1, 2); printf("%d\n", ans); } return 0; }