結果

問題 No.98 円を描こう
ユーザー kazu116kazu116
提出日時 2019-05-10 20:11:55
言語 Swift
(5.10.0)
結果
AC  
実行時間 6 ms / 5,000 ms
コード長 258 bytes
コンパイル時間 8,336 ms
コンパイル使用メモリ 172,568 KB
実行使用メモリ 13,476 KB
最終ジャッジ日時 2023-08-20 12:24:49
合計ジャッジ時間 3,356 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
12,956 KB
testcase_01 AC 5 ms
13,192 KB
testcase_02 AC 5 ms
12,956 KB
testcase_03 AC 6 ms
13,476 KB
testcase_04 AC 6 ms
13,432 KB
testcase_05 AC 5 ms
13,288 KB
testcase_06 AC 6 ms
13,472 KB
testcase_07 AC 6 ms
12,952 KB
testcase_08 AC 6 ms
13,024 KB
testcase_09 AC 6 ms
13,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import Foundation

let input:[Int] = readLine()!.split(separator: " ").map{Int($0)!}

let r:Double = sqrt(pow(Double(input[0]), 2.0) + pow(Double(input[1]), 2.0))
var d:Int = 1
while true {
    if Double(d) > r * 2 {
        break
    }
    d += 1
}
print(d)
0