結果
| 問題 | 
                            No.98 円を描こう
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-01-13 17:19:50 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 515 bytes | 
| コンパイル時間 | 4,126 ms | 
| コンパイル使用メモリ | 257,612 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-17 06:39:48 | 
| 合計ジャッジ時間 | 4,882 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 4 WA * 2 | 
ソースコード
//No.98 円を描こう
#pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
using namespace std;
signed main(){
    int px , py; cin >> px >> py;
    double dist = sqrt( px * px + py * py);
    double d = fabs(dist - static_cast<int>(dist));
    if( d >= 0.5 ) cout << ceil(dist) * 2 << endl;
    else if ( d == 0.0) cout << static_cast<int>(dist)*2 + 1 << endl;
    else if( d > 0.0 && d < 0.5) cout << static_cast<int>(d * 2) << endl;   
}