結果

問題 No.98 円を描こう
ユーザー momen999momen999
提出日時 2017-04-15 20:15:15
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 760 ms
コンパイル使用メモリ 154,032 KB
実行使用メモリ 7,268 KB
最終ジャッジ日時 2023-09-25 22:22:34
合計ジャッジ時間 1,709 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,024 KB
testcase_01 AC 2 ms
6,916 KB
testcase_02 AC 3 ms
7,016 KB
testcase_03 AC 3 ms
7,080 KB
testcase_04 AC 3 ms
7,164 KB
testcase_05 AC 3 ms
7,268 KB
testcase_06 WA -
testcase_07 AC 2 ms
7,152 KB
testcase_08 AC 2 ms
7,200 KB
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

hankei r d2 | r^2 == d2 = r * 2 + 1
            | r^2 > d2  = r * 2
            | otherwise = hankei (r + 1) d2

main = do
    str <- getLine
    let
        [x,y] = map read $ words str :: [Int]   -- 点
        d2 = x^2 + y^2                          -- 原点からの距離の2乗
    print $ hankei 0 d2

0