結果
問題 | No.1593 Perfect Distance |
ユーザー |
|
提出日時 | 2022-07-02 14:45:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 325 bytes |
コンパイル時間 | 663 ms |
コンパイル使用メモリ | 76,856 KB |
最終ジャッジ日時 | 2025-01-30 03:58:10 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <iostream>#include <cmath>using namespace std;long long N;long long Answer = 0;int main() {cin >> N;for (int x = 1; x <= N - 1; x++) {long long V = N * N - 1LL * x * x;long long y = (long long)(sqrt(1.0 * V) + 1.0e-9);if (x * x + y * y == N * N) Answer++;}cout << Answer << endl;return 0;}