結果

問題 No.380 悪の台本
ユーザー kurenai3110kurenai3110
提出日時 2017-01-31 22:36:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,011 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-24 14:55:02
合計ジャッジ時間 974 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sys
import re

di = re.compile(r'.*(n|N)(y|Y)(o|O)[^a-zA-Z0-9]{0,3}$')
pe = re.compile(r'.*(n|N)(y|Y)(u|U)[^a-zA-Z0-9]{0,3}$')
ra = re.compile(r'.*[a-zA-Z0-9]+')
ge = re.compile(r'.*(g|G)(e|E)(m|M)(a|A)[^a-zA-Z0-9]{0,3}$')
pi = re.compile(r'.*(p|P)(y|Y)(o|O)[^a-zA-Z0-9]{0,3}$')

AC='CORRECT (maybe)'
WA='WRONG!'

def solve(pattern,s):
    if re.match(pattern,s):
        return True
    return False

for s in sys.stdin:
    if s=='\n':
        print(WA)
        continue
    words = s.split()

    flag = False
    if words[0]=='digi':
        if solve(di,words[-1]):
            flag=True
    elif words[0]=='petit':
        if solve(pe,words[-1]):
            flag=True
    elif words[0]=='rabi':
        if solve(ra,words[-1]):
            flag=True       
    elif words[0]=='gema':
        if solve(ge,words[-1]):
            flag=True        
    elif words[0]=='piyo':
        if solve(pi,words[-1]):
            flag=True
            
    if flag:
        print(AC)
    else:
        print(WA)
0