結果
| 問題 |
No.1593 Perfect Distance
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-29 20:26:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 298 bytes |
| コンパイル時間 | 741 ms |
| コンパイル使用メモリ | 67,712 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-22 08:14:31 |
| 合計ジャッジ時間 | 1,701 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 5 |
ソースコード
#include <iostream>
#include <math.h>
using namespace std;
typedef long long LL;
int main()
{
LL N,N2;
cin >> N;
N2 = N * N;
LL nums = 0;
for (int x = 1; x < N; x++) {
double y = sqrt(N*N - x * x);
if (y==(int)y && x * x + y*y == N2) {
nums++;
}
}
cout << nums << endl;
return 0;
}