QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#278016#5553. Alternative Architecturejzh#WA 2ms3568kbC++20793b2023-12-07 10:46:472023-12-07 10:46:48

Judging History

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

  • [2023-12-07 10:46:48]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3568kb
  • [2023-12-07 10:46:47]
  • 提交

answer

//  M. Triangle Construction

#include<bits/stdc++.h>

using namespace std;

int check(int a) {

}

int main() {

    ios::sync_with_stdio(false);

    int a, b;
    cin >> a >> b;
    a--;
    b--;
    if (a > b)swap(a, b);
    int num = 1;
    num += (a != b);

    int p1 = 0, p2 = 0;
    for (int i = 1; i <= a; i++) {
        int j = sqrt(a);
        for (int k = max(1, j - 2); k <= j + 2 && k <= i; k++) {
            if (k * k + i * i == a * a) {
                p1 = k;
                p2 = i;
                if (b / a * a == b) {
                    num += 2;
                    if (p1 != p2) {
                        num += 2;
                    }
                }
            }
        }
    }


    cout << num;


    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3376kb

input:

6 11

output:

6

result:

ok single line: '6'

Test #2:

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

input:

26 26

output:

5

result:

ok single line: '5'

Test #3:

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

input:

123 456

output:

2

result:

ok single line: '2'

Test #4:

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

input:

3 3

output:

1

result:

ok single line: '1'

Test #5:

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

input:

2 2

output:

1

result:

ok single line: '1'

Test #6:

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

input:

2 1000000

output:

2

result:

ok single line: '2'

Test #7:

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

input:

1000000 2

output:

2

result:

ok single line: '2'

Test #8:

score: -100
Wrong Answer
time: 2ms
memory: 3440kb

input:

1000000 1000000

output:

1

result:

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