結果

問題 No.51 やる気の問題
ユーザー shikatsusanshikatsusan
提出日時 2016-05-19 16:10:53
言語 Haskell
(9.8.2)
結果
AC  
実行時間 47 ms / 5,000 ms
コード長 204 bytes
コンパイル時間 5,181 ms
コンパイル使用メモリ 171,136 KB
実行使用メモリ 25,344 KB
最終ジャッジ日時 2024-04-16 01:23:21
合計ジャッジ時間 3,452 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 30 ms
21,120 KB
testcase_06 AC 20 ms
16,128 KB
testcase_07 AC 17 ms
15,232 KB
testcase_08 AC 11 ms
12,032 KB
testcase_09 AC 40 ms
24,576 KB
testcase_10 AC 12 ms
12,544 KB
testcase_11 AC 11 ms
12,160 KB
testcase_12 AC 20 ms
16,768 KB
testcase_13 AC 27 ms
19,072 KB
testcase_14 AC 14 ms
13,312 KB
testcase_15 AC 36 ms
22,016 KB
testcase_16 AC 8 ms
9,472 KB
testcase_17 AC 4 ms
5,632 KB
testcase_18 AC 36 ms
22,400 KB
testcase_19 AC 36 ms
22,656 KB
testcase_20 AC 20 ms
15,872 KB
testcase_21 AC 3 ms
5,760 KB
testcase_22 AC 47 ms
25,344 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )

Main.hs:9:33: warning: [GHC-47082] [-Woperator-whitespace-ext-conflict]
    The prefix use of a ‘$’ would denote an untyped splice
      were the TemplateHaskell extension enabled.
    Suggested fix: Add whitespace after the ‘$’.
  |
9 |   print . snd . foldl' f1 (w,0) $[d,(d-1)..1]
  |                                 ^
[2 of 2] Linking a.out

ソースコード

diff #

import Data.Foldable
main::IO()
main = do
  w <-fmap read getLine
  d <-fmap read getLine
  let f1 (w,r) d = (w-amt,amt)
        where amt = w `div` (d*d)
  
  print . snd . foldl' f1 (w,0) $[d,(d-1)..1]
0