結果

問題 No.380 悪の台本
ユーザー kuuso1kuuso1
提出日時 2016-09-03 01:44:16
言語 F#
(F# 4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,307 bytes
コンパイル時間 4,342 ms
コンパイル使用メモリ 169,820 KB
実行使用メモリ 36,564 KB
最終ジャッジ日時 2023-08-06 20:09:47
合計ジャッジ時間 6,453 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 122 ms
28,396 KB
testcase_02 AC 121 ms
28,372 KB
testcase_03 AC 119 ms
26,308 KB
testcase_04 AC 138 ms
26,460 KB
testcase_05 AC 179 ms
36,564 KB
testcase_06 AC 168 ms
28,896 KB
testcase_07 AC 498 ms
30,816 KB
testcase_08 AC 133 ms
28,824 KB
testcase_09 AC 143 ms
28,340 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

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,ss) with
            | ("digi",_,_ ) when Regex.Match(s,"[nN][yY][oO][^a-zA-Z0-9]{0,3}$").Success && ss.Length > 1 -> okMsg
            | ("petit",_,_ ) when Regex.Match(s,"[nN][yY][uU][^a-zA-Z0-9]{0,3}$").Success && ss.Length > 1  -> okMsg
            | ("rabi",_,_ ) when ss.Length > 1 && Regex.Match(s.Substring(5),"[a-zA-Z0-9]").Success  -> okMsg
            | ("gema",_,_ ) when Regex.Match(s,"[gG][eE][mM][aA][^a-zA-Z0-9]{0,3}$").Success  && ss.Length > 1 -> okMsg
            | ("piyo",_,_ ) when Regex.Match(s,"[pP][yY][oO][^a-zA-Z0-9]{0,3}$").Success  && ss.Length > 1 -> okMsg
            | (_,_ ,_)  -> ngMsg
            
        
        let mutable chk = true
        let mutable input :string = ""
        while chk do
            input <- stdin.ReadLine()
            chk <- (input = null) |> not
            if chk then (if input = "" then ngMsg else input |> judgeWords )|> printfn "%s"
            
let mySol = new Sol()
mySol.Solve()
0