1 条题解
- 
  2
202507cj04王晟睿 (王晟睿) LV 7 @ 2025-04-19 20:59:45
#include <iostream>
#include <cmath>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int a;
cin >> a;
int sqrt_a = sqrt(a);
if (sqrt_a * sqrt_a != a) {
cout << "-1\n";
continue;
}
int sqrt_b = sqrt(sqrt_a);
if (sqrt_b * sqrt_b == sqrt_a) {
cout << sqrt_b << '\n';
} else {
cout << "-1\n";
}
}
return 0;
} 
- 1
 
信息
- ID
 - 2849
 - 难度
 - 7
 - 分类
 - (无)
 - 标签
 - 递交数
 - 193
 - 已通过
 - 34
 - 通过率
 - 18%
 - 上传者