結果

問題 No.380 悪の台本
ユーザー 👑 kmjpkmjp
提出日時 2016-06-18 00:20:59
言語 Python2
(2.7.18)
結果
AC  
実行時間 234 ms / 1,000 ms
コード長 720 bytes
コンパイル時間 52 ms
コンパイル使用メモリ 6,740 KB
実行使用メモリ 6,056 KB
最終ジャッジ日時 2023-08-06 19:46:47
合計ジャッジ時間 1,131 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,000 KB
testcase_01 AC 12 ms
5,944 KB
testcase_02 AC 11 ms
6,028 KB
testcase_03 AC 12 ms
5,936 KB
testcase_04 AC 21 ms
6,028 KB
testcase_05 AC 36 ms
6,056 KB
testcase_06 AC 32 ms
5,852 KB
testcase_07 AC 234 ms
5,988 KB
testcase_08 AC 36 ms
5,996 KB
testcase_09 AC 20 ms
5,956 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