Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
42112 Gapple 【S】T1 C++ 通过 100 1 MS 280 KB 762 2026-06-13 14:33:05

Tests(10/10):


#include <iostream> using namespace std; using i64 = long long; struct Solution { void main() { i64 n; cin >> n; int cnt; for (cnt = 0; n > 1; ++cnt) { if (n % 2 == 0) n >>= 1; else if (n % 3 == 0) (n <<= 1) /= 3; else if (n % 5 == 0) (n <<= 2) /= 5; else { cout << "-1\n"; return; } } cout << cnt << '\n'; } }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int T; cin >> T; while (T-- > 0) Solution().main(); cout << flush; return 0; }


测评信息: