結果
問題 |
No.380 悪の台本
|
ユーザー |
![]() |
提出日時 | 2016-06-17 23:47:31 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 731 bytes |
コンパイル時間 | 101 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 9,472 KB |
最終ジャッジ日時 | 2024-11-06 22:44:40 |
合計ジャッジ時間 | 1,145 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 WA * 2 |
ソースコード
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 id += len(tail) if len(S) - id > 4: return 0 for i in range(id,len(S)): if iskigo(S[i])==0: return 0 return 1 while 1: try: S=raw_input().lower() except: break yes = 0 if S.startswith("digi "): yes = hoge("nyo",S[5:]) elif S.startswith("petit "): yes = hoge("nyu",S[6:]) elif S.startswith("rabi "): S=S[5:] for i in range(len(S)): if iskigo(S[i])==0: yes=1 elif S.startswith("gema "): yes = hoge("gema",S[5:]) elif S.startswith("piyo "): yes = hoge("pyo",S[5:]) if yes == 1: print "CORRECT (maybe)" else: print "WRONG!"