結果
問題 |
No.380 悪の台本
|
ユーザー |
![]() |
提出日時 | 2016-06-17 23:26:33 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 865 bytes |
コンパイル時間 | 84 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 9,728 KB |
最終ジャッジ日時 | 2024-11-06 22:41:31 |
合計ジャッジ時間 | 1,060 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 WA * 1 |
ソースコード
import sys def iskigo(c): if c.isdigit(): return 0 if c.isalpha(): return 0 return 1 def hoge(tail,S): id = S.rfind(tail) if id < 0: return 0 if len(S) - (id + len(tail)) > 4: return 0 for i in range(id+len(tail),len(S)): if iskigo(S[i])==0: return 0 return 1 while 1: try: S=raw_input().strip("\n") except: break if S=="": print "WRONG!" continue A=S.split(" ",1) if A[0]=="": print "WRONG!" continue if len(A)==1: print "WRONG!" continue C=A[0] S=A[1].lower() yes = 0 if C=="digi": yes = hoge("nyo",S) elif C=="petit": yes = hoge("nyu",S) elif C=="rabi": for i in range(len(S)): if iskigo(S[i])==0: yes=1 elif C=="gema": yes = hoge("gema",S) elif C=="piyo": yes = hoge("pyo",S) else: print "WRONG!" continue if yes == 1: print "CORRECT (maybe)" else: print "WRONG!"