結果
| 問題 | 
                            No.1593 Perfect Distance
                             | 
                    
| コンテスト | |
| ユーザー | 
                             shishimaiotoshi
                         | 
                    
| 提出日時 | 2021-08-19 23:45:40 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 410 bytes | 
| コンパイル時間 | 1,402 ms | 
| コンパイル使用メモリ | 166,192 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-13 01:36:10 | 
| 合計ジャッジ時間 | 2,228 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 12 WA * 5 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n, o) for(int i = o;i < (n);i++)
#define ou(x) cout << x << endl
#define ll long long
#define re return 0
int main(){
    ll n;
    int cnt = 0;
    cin >> n;
    rep(i, n + 1, 1){
        ll y = (ll)sqrt(n * n - i * i);
        if(y == 0) continue;
        if((y * y + i * i) == (n * n)){
            cnt++;
        }
    }
    ou(cnt);
    re;
}
            
            
            
        
            
shishimaiotoshi