結果

問題 No.892 タピオカ
ユーザー 情報学生情報学生
提出日時 2019-09-27 21:39:21
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 395 bytes
コンパイル時間 9,072 ms
コンパイル使用メモリ 163,624 KB
実行使用メモリ 5,752 KB
最終ジャッジ日時 2023-10-25 02:09:40
合計ジャッジ時間 6,184 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

-- 間違ったやり方
power :: Integer -> Integer -> Integer
power _ 0       = 1
power n 1       = n
power n x
    | odd x     = n * z * z
    | otherwise = z * z
    where z = power n (x `div` 2)

main :: IO ()
main = do
    [a, x, b, y, c, z] <- map (read :: String -> Integer) . words <$> getLine
    let d = power a x + power b y + power c z
    putStrLn $ if even d then ":-)" else ":-("
0