| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38604 | Gapple | 【S】T2 | C++ | 运行超时 | 50 | 1000 MS | 204 KB | 1495 | 2025-10-18 13:29:59 |
#pragma GCC optimize("Ofast,no-stack-protector,fast-math,inline,unroll-loops") #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> using namespace std; using i64 = long long; constexpr int SQRT_EDGE = 54, MAX_EDGE = 3000, MAX_COST = 95; template <class T> void read(T& val) { char ch = getchar(); while (!isdigit(ch)) ch = getchar(); val = 0; while (isdigit(ch)) { val = val * 10 + ch - '0'; ch = getchar(); } } int power[SQRT_EDGE + 1]; inline void init() { for (int i = 1; i <= SQRT_EDGE; ++i) power[i] = pow(i, 8.0 / 7); } struct Solution { int y, ans = 1; void solve(i64 cur, int len = 1, int step = 2) { if (cur > y) return; else if (step == 1 && (y > MAX_EDGE * MAX_EDGE * cur || ans > MAX_COST * MAX_COST * len)) 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) solve(cur * i * i, len * power[i], step - 1); } void main() { i64 x; read(x); read(y); solve(x); printf("%d\n", ans); } }; int main() { int t; init(); read(t); while (t-- > 0) Solution().main(); return 0; }