結果

問題 No.446 ゆきこーだーの雨と雪 (1)
コンテスト
ユーザー Leonardone
提出日時 2017-05-05 22:57:35
言語 Haskell
(9.14.1)
コンパイル:
ghc -rtsopts -with-rtsopts=-K1G -o a.out -O2 _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 421 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,098 ms
コンパイル使用メモリ 196,480 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-04-04 11:41:10
合計ジャッジ時間 5,835 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #
raw source code

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

main = getContents >>= putStrLn . solve . words

solve [a,b] = if check a && check b then "OK" else "NG"

check xs@(x:_)
    | checkAllNum xs = let v = read xs
                       in if x == '0' then v == 0 else v <= 12345
    | otherwise = False

checkAllNum [] = True
checkAllNum (x:xs)
    | '0' <= x && x <= '9' = checkAllNum xs
    | otherwise = False
0