結果

問題 No.380 悪の台本
ユーザー tookunn_1213tookunn_1213
提出日時 2016-09-29 17:37:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 885 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-04-24 14:49:01
合計ジャッジ時間 1,198 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 30 ms
10,624 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 123 ms
11,648 KB
testcase_08 AC 37 ms
11,136 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def delEnd(sentence):
	i = len(sentence) - 1
	cnt = 0
	while cnt < 3:
		if sentence[i].isalnum():
			break
		i-=1
		cnt+=1
	return sentence[0:i + 1]
def isdigi(s):
	return s[-3:] == 'nyo'
def ispetit(s):
	return s[-3:] == 'nyu'
def isgema(s):
	return s[-4:] == 'gema'
def ispiyo(s):
	return s[-3:] == 'pyo'
def israbi(s):
	for i in s:
		if i.isalnum():
			return True
	return False
def getName(sentence):
	sentence = delEnd(sentence).lower()
	if isdigi(sentence):
		return 'digi'
	if ispetit(sentence):
		return 'petit'
	if isgema(sentence):
		return 'gema'
	if ispiyo(sentence):
		return 'piyo'
	if israbi(sentence):
		return 'rabi'
	return 'none'
S = sys.stdin.readlines()
for ss in S:
	if len(ss.split()) <= 1:
		print('WRONG!')
		continue
	s = ss[:-1]
	s1 = s[:s.index(' ')].lower()
	s2 = s[s.index(' ') + 1:]
	print('CORRECT (maybe)' if getName(s2) == s1 else 'WRONG!')
0