結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー nobsunnobsun
提出日時 2018-06-16 07:53:51
言語 Haskell
(9.8.2)
結果
AC  
実行時間 762 ms / 3,000 ms
コード長 225 bytes
コンパイル時間 625 ms
コンパイル使用メモリ 154,232 KB
実行使用メモリ 124,824 KB
最終ジャッジ日時 2023-09-13 05:56:30
合計ジャッジ時間 7,929 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,980 KB
testcase_01 AC 2 ms
7,072 KB
testcase_02 AC 3 ms
6,976 KB
testcase_03 AC 3 ms
6,924 KB
testcase_04 AC 3 ms
7,184 KB
testcase_05 AC 4 ms
7,912 KB
testcase_06 AC 12 ms
11,512 KB
testcase_07 AC 52 ms
19,424 KB
testcase_08 AC 243 ms
54,272 KB
testcase_09 AC 373 ms
73,784 KB
testcase_10 AC 703 ms
115,784 KB
testcase_11 AC 713 ms
117,840 KB
testcase_12 AC 723 ms
119,844 KB
testcase_13 AC 742 ms
122,796 KB
testcase_14 AC 702 ms
117,840 KB
testcase_15 AC 712 ms
119,904 KB
testcase_16 AC 762 ms
124,824 KB
testcase_17 AC 3 ms
6,852 KB
testcase_18 AC 3 ms
6,924 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

module Main where

main :: IO ()
main = do
  { n <- getInt
  ; print =<< loop n 0
  }

loop :: Int -> Int -> IO Int
loop 0 s = return s
loop n s = loop (pred n) . (s +) =<< getInt

getInt :: IO Int
getInt = read <$> getLine

0