QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#588062 | #5553. Alternative Architecture | BFR | WA | 0ms | 3636kb | C++20 | 581b | 2024-09-25 00:09:13 | 2024-09-25 00:09:13 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
bool isSQRT(long long a) {
long long s = sqrt(a);
return (s * s == a);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
long long a, b;
cin >> a >> b;
a--;
b--;
int ans = 1;
if (a != b) ans++;
for (long long i = 1; i <= (long long)ceil((long double)a / 2.0); i++) {
if (isSQRT(a * a - i * i)) {
if ((i * b) % a == 0) {
ans += 4;
}
}
}
cout << ans << endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3608kb
input:
6 11
output:
6
result:
ok single line: '6'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
26 26
output:
5
result:
ok single line: '5'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
123 456
output:
2
result:
ok single line: '2'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
3 3
output:
1
result:
ok single line: '1'
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3548kb
input:
2 2
output:
5
result:
wrong answer 1st lines differ - expected: '1', found: '5'