結果

問題 No.380 悪の台本
ユーザー 👑 kmjpkmjp
提出日時 2016-06-18 00:20:59
言語 Python2
(2.7.18)
結果
AC  
実行時間 214 ms / 1,000 ms
コード長 720 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,656 KB
最終ジャッジ日時 2024-04-24 14:27:31
合計ジャッジ時間 1,042 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,272 KB
testcase_01 AC 9 ms
6,272 KB
testcase_02 AC 10 ms
6,144 KB
testcase_03 AC 10 ms
6,272 KB
testcase_04 AC 19 ms
6,272 KB
testcase_05 AC 36 ms
6,272 KB
testcase_06 AC 32 ms
6,272 KB
testcase_07 AC 214 ms
6,272 KB
testcase_08 AC 33 ms
6,656 KB
testcase_09 AC 16 ms
6,272 KB
権限があれば一括ダウンロードができます

ソースコード

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