結果

問題 No.365 ジェンガソート
ユーザー LeonardoneLeonardone
提出日時 2016-05-01 06:26:35
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 7,664 ms
コンパイル使用メモリ 176,384 KB
実行使用メモリ 34,944 KB
最終ジャッジ日時 2024-04-15 08:17:10
合計ジャッジ時間 13,684 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 WA -
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 WA -
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 WA -
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 232 ms
29,184 KB
testcase_17 AC 246 ms
33,664 KB
testcase_18 AC 22 ms
10,112 KB
testcase_19 AC 236 ms
33,408 KB
testcase_20 AC 81 ms
16,128 KB
testcase_21 AC 63 ms
13,952 KB
testcase_22 AC 222 ms
28,800 KB
testcase_23 AC 110 ms
19,072 KB
testcase_24 AC 219 ms
27,648 KB
testcase_25 AC 56 ms
13,952 KB
testcase_26 AC 143 ms
21,248 KB
testcase_27 AC 261 ms
34,560 KB
testcase_28 AC 139 ms
21,120 KB
testcase_29 AC 243 ms
32,896 KB
testcase_30 AC 150 ms
21,120 KB
testcase_31 AC 77 ms
15,232 KB
testcase_32 AC 66 ms
14,592 KB
testcase_33 AC 251 ms
34,560 KB
testcase_34 AC 42 ms
12,928 KB
testcase_35 AC 235 ms
28,160 KB
testcase_36 AC 256 ms
34,944 KB
testcase_37 WA -
testcase_38 AC 255 ms
34,944 KB
testcase_39 AC 262 ms
34,688 KB
testcase_40 AC 271 ms
34,688 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:4:50: warning: [GHC-63394] [-Wx-partial]
    In the use of ‘tail’
    (imported from Prelude, but defined in GHC.List):
    "This is a partial function, it throws an error on empty lists. Replace it with drop 1, or use pattern matching or Data.List.uncons instead. Consider refactoring to use Data.List.NonEmpty."
  |
4 | main = print . snd . foldl f (0, 0) . map read . tail . words =<< (getLine >> getLine)
  |                                                  ^^^^
[2 of 2] Linking a.out

ソースコード

diff #

-- yukicoder My Practice
-- author: Leonardone @ NEETSDKASU

main = print . snd . foldl f (0, 0) . map read . tail . words =<< (getLine >> getLine)
    where
        f tp nm = 
            if nm > fst tp
                then
                    (nm, snd tp)
                else
                    if nm > snd tp
                        then
                            (fst tp, nm)
                        else
                            tp
            
0