結果

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

ソースコード

diff #
raw source code

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