結果

問題 No.380 悪の台本
ユーザー koyumeishikoyumeishi
提出日時 2016-06-19 09:16:10
言語 Go
(1.22.1)
結果
AC  
実行時間 156 ms / 1,000 ms
コード長 790 bytes
コンパイル時間 15,219 ms
コンパイル使用メモリ 221,256 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 14:33:49
合計ジャッジ時間 15,750 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 2 ms
5,248 KB
testcase_03 AC 2 ms
5,248 KB
testcase_04 AC 7 ms
5,376 KB
testcase_05 AC 22 ms
5,376 KB
testcase_06 AC 21 ms
5,376 KB
testcase_07 AC 156 ms
5,376 KB
testcase_08 AC 8 ms
5,376 KB
testcase_09 AC 8 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main
import (
  "regexp"
  "fmt"
  "bufio"
  "os"
)

func main(){
  rd := bufio.NewReaderSize(os.Stdin, 1000000)

  var reg [5]*regexp.Regexp
  reg[0] = regexp.MustCompile(`^digi\s.*[nN][yY][oO][^0-9a-zA-Z]{0,3}$`)
  reg[1] = regexp.MustCompile(`^petit\s.*[nN][yY][uU][^0-9a-zA-Z]{0,3}$`)
  reg[2] = regexp.MustCompile(`^gema\s.*[gG][eE][mM][aA][^0-9a-zA-Z]{0,3}$`)
  reg[3] = regexp.MustCompile(`^piyo\s.*[pP][yY][oO][^0-9a-zA-Z]{0,3}$`)
  reg[4] = regexp.MustCompile(`^rabi\s.*[0-9a-zA-Z].*$`)

  s,_,err := rd.ReadLine()
  for ; err == nil; {
    ok := false
    for _, r := range reg {
      if r.Match([]byte(s)) {
        ok = true
      }
    }

    if ok {
      fmt.Println("CORRECT (maybe)")
    }else {
      fmt.Println("WRONG!")
    }

    s,_,err = rd.ReadLine()
  }
}
0