結果
| 問題 | 
                            No.98 円を描こう
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2017-08-10 22:54:39 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 29 ms / 5,000 ms | 
| コード長 | 378 bytes | 
| コンパイル時間 | 77 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 11,008 KB | 
| 最終ジャッジ日時 | 2024-10-12 04:09:30 | 
| 合計ジャッジ時間 | 1,014 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 6 | 
ソースコード
# -*- coding: utf-8 -*-
import math
xp, yp = map(int, input().split())
hypotenuses = pow(pow(xp,2)+pow(yp,2), 0.5)
int_hypo = math.ceil(hypotenuses)
diameter = 0
if pow(int_hypo,2) == (pow(xp,2)+pow(yp,2)):
    diameter = int_hypo*2 + 1
else:
    if int_hypo-0.5 > hypotenuses:
        diameter = int((int_hypo-0.5)*2)
    else:
        diameter = int_hypo*2
print(diameter)