結果

問題 No.380 悪の台本
コンテスト
ユーザー 👑 kmjp
提出日時 2016-06-17 23:47:31
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 731 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 133 ms
コンパイル使用メモリ 77,472 KB
最終ジャッジ日時 2025-12-03 20:53:10
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 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
	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!"
0