結果

問題 No.380 悪の台本
ユーザー kmjp
提出日時 2016-06-18 00:20:59
言語 Python2
(2.7.18)
結果
AC  
実行時間 240 ms / 1,000 ms
コード長 720 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-11-06 22:50:49
合計ジャッジ時間 1,126 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def iskigo(c):
	if c.isdigit() or 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 > 3:
		return 0
	
	for i in range(id,len(S)):
		if iskigo(S[i])==0:
			return 0
	return 1

while 1:
	try:
		S=raw_input()
	except:
		break
	
	yes = 0
	if S.startswith("digi "):
		yes = hoge("nyo",S[5:].lower())
	elif S.startswith("petit "):
		yes = hoge("nyu",S[6:].lower())
	elif S.startswith("rabi "):
		for i in S[5:]:
			if iskigo(i)==0:
				yes=1
	elif S.startswith("gema "):
		yes = hoge("gema",S[5:].lower())
	elif S.startswith("piyo "):
		yes = hoge("pyo",S[5:].lower())
	
	if yes == 1:
		print "CORRECT (maybe)"
	else:
		print "WRONG!"
0