結果

問題 No.380 悪の台本
ユーザー pluto77pluto77
提出日時 2016-10-30 13:19:08
言語 Python2
(2.7.18)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 838 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 7,040 KB
最終ジャッジ日時 2024-04-24 14:51:10
合計ジャッジ時間 868 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 11 ms
6,016 KB
testcase_02 AC 12 ms
6,144 KB
testcase_03 AC 10 ms
6,144 KB
testcase_04 AC 18 ms
6,144 KB
testcase_05 AC 50 ms
6,016 KB
testcase_06 AC 39 ms
6,144 KB
testcase_07 AC 67 ms
6,016 KB
testcase_08 AC 16 ms
7,040 KB
testcase_09 AC 25 ms
6,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_304
import sys
import re

def head(s):
 t=a.split(' ')
 if len(t)==1:
  return False
 else:
  return t[0]

def tail(s,pt):
 match=re.search(pt+'[\W_]{0,3}$',s,re.IGNORECASE)
 if match:
  return True
 else:
  return False

def body(s):
 t=s[5:]
 match=re.search('[A-Za-z0-9]',t)
 if match:
  return True
 else:
  return False

a=sys.stdin.readline()
while a:
 if len(a)<4:
  print 'WRONG!'
  a=sys.stdin.readline()
  continue
 if head(a)=='digi' and tail(a,'nyo')==True:
  print 'CORRECT (maybe)'
 elif head(a)=='petit' and tail(a,'nyu')==True:
  print 'CORRECT (maybe)'
 elif head(a)=='rabi' and body(a)==True:
  print 'CORRECT (maybe)'
 elif head(a)=='gema' and tail(a,'gema')==True:
  print 'CORRECT (maybe)'
 elif head(a)=='piyo' and tail(a,'pyo')==True:
  print 'CORRECT (maybe)'
 else:
  print 'WRONG!'
 a=sys.stdin.readline()
0