QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#588064#5553. Alternative ArchitectureBFRWA 1ms3704kbC++20604b2024-09-25 00:12:502024-09-25 00:12:50

Judging History

你现在查看的是最新测评结果

  • [2024-09-25 00:12:50]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3704kb
  • [2024-09-25 00:12:50]
  • 提交

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) and a * a - i * i != 0) {
            if ((i * b) % a == 0) {
                ans += 4;
            }
        }
    }
    cout << ans << endl;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3556kb

input:

6 11

output:

6

result:

ok single line: '6'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

26 26

output:

5

result:

ok single line: '5'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3704kb

input:

123 456

output:

2

result:

ok single line: '2'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

3 3

output:

1

result:

ok single line: '1'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

2 2

output:

1

result:

ok single line: '1'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

2 1000000

output:

2

result:

ok single line: '2'

Test #7:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

1000000 2

output:

2

result:

ok single line: '2'

Test #8:

score: -100
Wrong Answer
time: 1ms
memory: 3616kb

input:

1000000 1000000

output:

13

result:

wrong answer 1st lines differ - expected: '9', found: '13'