QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#278021#5553. Alternative Architecturejzh#WA 1ms3452kbC++20809b2023-12-07 10:50:082023-12-07 10:50:09

Judging History

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

  • [2023-12-07 10:50:09]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3452kb
  • [2023-12-07 10:50:08]
  • 提交

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 * a - i * i);
        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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6 11

output:

6

result:

ok single line: '6'

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3372kb

input:

26 26

output:

9

result:

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