| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38650 | Gapple | 【S】T2 | C++ | 通过 | 100 | 100 MS | 536 KB | 687 | 2025-10-18 14:40:42 |
#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 = 2; i <= SQRT_DIFF; ++i) { for (int j = 2; j <= SQRT_EDGE; ++j) dist[i] = max(dist[i], dist[i / j] * 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; }