結果

問題 No.380 悪の台本
ユーザー 👑 kmjpkmjp
提出日時 2016-06-17 22:48:14
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 764 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 9,728 KB
最終ジャッジ日時 2024-04-24 14:14:56
合計ジャッジ時間 826 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,272 KB
testcase_01 WA -
testcase_02 AC 11 ms
6,144 KB
testcase_03 AC 10 ms
6,272 KB
testcase_04 AC 23 ms
6,144 KB
testcase_05 AC 40 ms
6,144 KB
testcase_06 AC 35 ms
6,272 KB
testcase_07 WA -
testcase_08 AC 45 ms
9,728 KB
testcase_09 AC 21 ms
6,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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
	
	A=S.split(" ",1)
	if A[0]=="":
		break
	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)
		
	
	
	if yes == 1:
		print "CORRECT (maybe)"
	else:
		print "WRONG!"
0