結果

問題 No.380 悪の台本
ユーザー pluto77
提出日時 2016-10-30 12:50:42
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 768 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-11-06 23:17:21
合計ジャッジ時間 906 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 WA * 1 RE * 2
権限があれば一括ダウンロードができます

ソースコード

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 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