結果
問題 |
No.380 悪の台本
|
ユーザー |
![]() |
提出日時 | 2016-06-18 02:46:29 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 624 bytes |
コンパイル時間 | 62 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 35,328 KB |
最終ジャッジ日時 | 2024-11-06 22:55:40 |
合計ジャッジ時間 | 2,105 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 WA * 4 |
コンパイルメッセージ
Syntax OK
ソースコード
a=[] while (g=gets)!=nil do a.push(g.chomp.partition(/ +/)) end c=["digi","petit","rabi","gema","piyo"] norm=[/[nN][yY][oO][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/,/[nN][yY][uU][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/,/[a-zA-Z0-9]+/,/[gG][eE][mM][aA][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/,/[pO][yY][oO][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/] a.length.times do |i| cr=a[i][0] st=a[i][2] j=0 while j<c.length&&cr!=c[j] do j+=1 end if j>=c.length puts "WRONG!" next end if st=~norm[j] puts "CORRECT (maybe)" else puts "WRONG!" end end