QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#207970 | #6566. Power of Divisors | Thallium54# | WA | 0ms | 3860kb | C++20 | 1.1kb | 2023-10-09 01:30:38 | 2023-10-09 01:30:39 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define f first
#define s second
#define pb push_back
#define pii pair<int, int>
const int N = 1e5 + 100;
const int inf = 1e9;
const ll mod = 9302023;
int main()
{
ll x;
cin >> x;
for (int i = 1; i <= 1000; i++) {
int cnt = 0;
for (int f = 1; f * f <= i; f++) {
if (i % f == 0) {
cnt++;
if (i / f != f) {
cnt++;
}
}
}
__int128 p = 1;
for (int j = 0; j < cnt; j++) {
p *= i;
if (p > 1e18) {
break;
}
}
if (p == x) {
cout << i << endl;
return 0;
}
}
cout << -1 << endl;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
input:
15625
output:
25
result:
ok single line: '25'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
64000000
output:
20
result:
ok single line: '20'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
65536
output:
-1
result:
ok single line: '-1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
1
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
10
output:
-1
result:
ok single line: '-1'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
100
output:
-1
result:
ok single line: '-1'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
10000
output:
10
result:
ok single line: '10'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
1000000000000000000
output:
100
result:
ok single line: '100'
Test #9:
score: -100
Wrong Answer
time: 0ms
memory: 3600kb
input:
10372926089038969
output:
-1
result:
wrong answer 1st lines differ - expected: '218089', found: '-1'