結果

問題 No.380 悪の台本
ユーザー kimiyukikimiyuki
提出日時 2016-07-05 17:58:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 234 ms / 1,000 ms
コード長 658 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-24 14:38:40
合計ジャッジ時間 1,228 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,496 KB
testcase_01 AC 30 ms
10,240 KB
testcase_02 AC 31 ms
10,368 KB
testcase_03 AC 29 ms
10,368 KB
testcase_04 AC 33 ms
10,368 KB
testcase_05 AC 52 ms
10,496 KB
testcase_06 AC 51 ms
10,496 KB
testcase_07 AC 234 ms
10,496 KB
testcase_08 AC 39 ms
10,752 KB
testcase_09 AC 36 ms
10,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
import re
for line in sys.stdin:
    for i in range(4):
        if not line or line[-1].isalnum():
            break
        line = line[:-1]
    if line.startswith('digi '):
        ans = line.lower().endswith('nyo')
    elif line.startswith('petit '):
        ans = line.lower().endswith('nyu')
    elif line.startswith('rabi '):
        ans = any(map(lambda c: c.isalnum(), line[5:]))
    elif line.startswith('gema '):
        ans = line.lower().endswith('gema')
    elif line.startswith('piyo '):
        ans = line.lower().endswith('pyo')
    else:
        ans = False
    print(ans and 'CORRECT (maybe)' or 'WRONG!')
0