QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#278069 | #5553. Alternative Architecture | jzh# | WA | 0ms | 3640kb | C++20 | 1002b | 2023-12-07 11:29:16 | 2023-12-07 11:29:17 |
Judging History
answer
// M. Triangle Construction
#include<bits/stdc++.h>
using namespace std;
int check(int a) {
}
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
ll a, b;
cin >> a >> b;
a--;
b--;
if (a > b)swap(a, b);
int num = 1;
num += (a != b);
ll 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;
// cout << " find in " << p1 << "," << p2 << endl;
if (1ll*i*a/b == 1ll*i*a && 1ll*k*a/b == 1ll*k*a) {
num++;
num += (a != b);
if (p1 != p2) {
num += (a != b);
num ++;
}
}
}
}
}
cout << num;
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3640kb
input:
6 11
output:
2
result:
wrong answer 1st lines differ - expected: '6', found: '2'