結果

問題 No.380 悪の台本
ユーザー kuuso1kuuso1
提出日時 2016-09-03 01:26:21
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 1,177 bytes
コンパイル時間 7,931 ms
コンパイル使用メモリ 189,396 KB
実行使用メモリ 36,736 KB
最終ジャッジ日時 2024-04-24 14:48:06
合計ジャッジ時間 8,288 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 67 ms
32,876 KB
testcase_03 AC 67 ms
32,748 KB
testcase_04 AC 75 ms
34,048 KB
testcase_05 AC 111 ms
36,736 KB
testcase_06 AC 108 ms
36,204 KB
testcase_07 WA -
testcase_08 AC 72 ms
35,072 KB
testcase_09 AC 84 ms
34,816 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (217 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System
open System.Text.RegularExpressions

let ri () = stdin.ReadLine() |> int
let ria () = stdin.ReadLine().Split() |> Array.map int

type Sol() =
    member this.Solve() = 
        
        let okMsg = "CORRECT (maybe)"
        let ngMsg = "WRONG!"
        let judgeWords (s :string) =
            let ss = s.Split()
            match (ss.[0] ,s) with
            | ("digi",_ ) when Regex.Match(s,"[nN][yY][oO][^a-zA-Z0-9]{0,3}$").Success  -> okMsg
            | ("petit",_ ) when Regex.Match(s,"[nN][yY][uU][^a-zA-Z0-9]{0,3}$").Success  -> okMsg
            | ("rabi",_ ) when Regex.Match(s,"[^a-zA-Z0-9]").Success  -> okMsg
            | ("gema",_ ) when Regex.Match(s,"[gG][eE][mM][aA][^a-zA-Z0-9]{0,3}$").Success  -> okMsg
            | ("piyo",_ ) when Regex.Match(s,"[pP][yY][oO][^a-zA-Z0-9]{0,3}$").Success  -> okMsg
            | (_,_ )  -> ngMsg
            
        
        let mutable chk = true
        let mutable input :string = ""
        while chk do
            input <- stdin.ReadLine()
            chk <- String.IsNullOrEmpty(input) |> not
            if chk then input |> judgeWords |> printfn "%s"
            
let mySol = new Sol()
mySol.Solve()
0