結果

問題 No.380 悪の台本
コンテスト
ユーザー 👑 kmjp
提出日時 2016-06-17 22:50:57
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 804 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 154 ms
コンパイル使用メモリ 77,312 KB
最終ジャッジ日時 2025-12-03 20:52:37
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 4 WA * 2 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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
	
	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)
	else:
		sys.exit("aa! errors!")
	
	
	
	if yes == 1:
		print "CORRECT (maybe)"
	else:
		print "WRONG!"
0