結果

問題 No.380 悪の台本
コンテスト
ユーザー kokoa1046
提出日時 2017-10-03 19:22:49
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 224 ms / 1,000 ms
コード長 624 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 540 ms
コンパイル使用メモリ 20,704 KB
実行使用メモリ 15,228 KB
最終ジャッジ日時 2026-05-11 10:26:09
合計ジャッジ時間 3,192 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
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