結果
| 問題 | 
                            No.1593 Perfect Distance
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-09-17 23:15:27 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 449 bytes | 
| コンパイル時間 | 767 ms | 
| コンパイル使用メモリ | 90,716 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-29 22:01:33 | 
| 合計ジャッジ時間 | 1,472 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 12 WA * 5 | 
ソースコード
#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<ios>
#include<iomanip> 
#include<cmath>
#include<limits>
#include<algorithm>
using namespace std;
int main(){
    int n;
    cin >> n;
    long long count = 0;
    for(int i=1; i<=n; i++){
        long long x = i;
        long long y = sqrt(n*n - x*x);
        if(n*n == (x*x + y*y) && y!=0 && x!=0) count++;
    }
    cout << count << endl;
    return 0;
}