1 条题解

  • 0
    @ 2025-8-27 19:51:06

    C++ :

    #include <iostream>
    #include <cmath>
    using namespace std;
    int main() {
        int t;
        cin >> t;
        while (t--) {
            int a;
            cin >> a;
            int b = (int)(sqrt(sqrt(a)));
            if (b * b * b * b == a) {
                cout << b << endl;
            } else {
                cout << -1 << endl;
            }
        }
        return 0;
    }
    
    • 1

    信息

    ID
    5329
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者