結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,752 KB
testcase_01 AC 30 ms
10,624 KB
testcase_02 AC 29 ms
10,624 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 31 ms
10,880 KB
testcase_05 AC 50 ms
11,136 KB
testcase_06 AC 50 ms
11,136 KB
testcase_07 AC 124 ms
11,392 KB
testcase_08 AC 32 ms
11,136 KB
testcase_09 AC 33 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def delEnd(sentence):
	i = len(sentence) - 1
	cnt = 0
	while cnt < 3 and i >= 0:
		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
S = sys.stdin.readlines()
for ss in S:
	s = ss[:-1]
	if len(s.split()) <= 1:
		print('WRONG!')
		continue
	s1 = s[:s.index(' ')]
	s2 = delEnd(s[s.index(' ') + 1:].lower())
	if s1 == 'digi':
		print('CORRECT (maybe)' if isdigi(s2) else 'WRONG!')
	elif s1 == 'petit':
		print('CORRECT (maybe)' if ispetit(s2) else 'WRONG!')
	elif s1 == 'rabi':
		print('CORRECT (maybe)' if israbi(s2) else 'WRONG!')
	elif s1 == 'gema':
		print('CORRECT (maybe)' if isgema(s2) else 'WRONG!')
	elif s1 == 'piyo':
		print('CORRECT (maybe)' if ispiyo(s2) else 'WRONG!')
	else:
		print('WRONG!')
0