結果
| 問題 | No.380 悪の台本 |
| コンテスト | |
| ユーザー |
xkumiyu
|
| 提出日時 | 2018-06-15 21:41:58 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 672 bytes |
| 記録 | |
| コンパイル時間 | 470 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-03-20 17:53:29 |
| 合計ジャッジ時間 | 2,600 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 7 WA * 1 |
コンパイルメッセージ
Main.py:4: SyntaxWarning: "\s" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\s"? A raw string is also an option.
'digi': re.compile('(n|N)(y|Y)(o|O)([!-/:-@[-`{-~]|\s){0,3}$'),
Main.py:5: SyntaxWarning: "\s" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\s"? A raw string is also an option.
'petit': re.compile('(n|N)(y|Y)(u|U)([!-/:-@[-`{-~]|\s){0,3}$'),
Main.py:6: SyntaxWarning: "\w" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\w"? A raw string is also an option.
'rabi': re.compile('\w'),
Main.py:7: SyntaxWarning: "\s" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\s"? A raw string is also an option.
'gema': re.compile('(g|G)(e|E)(m|M)(a|A)([!-/:-@[-`{-~]|\s){0,3}$'),
Main.py:8: SyntaxWarning: "\s" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\s"? A raw string is also an option.
'piyo': re.compile('(p|P)(y|Y)(o|O)([!-/:-@[-`{-~]|\s){0,3}$')
ソースコード
import re
ptn = {
'digi': re.compile('(n|N)(y|Y)(o|O)([!-/:-@[-`{-~]|\s){0,3}$'),
'petit': re.compile('(n|N)(y|Y)(u|U)([!-/:-@[-`{-~]|\s){0,3}$'),
'rabi': re.compile('\w'),
'gema': re.compile('(g|G)(e|E)(m|M)(a|A)([!-/:-@[-`{-~]|\s){0,3}$'),
'piyo': re.compile('(p|P)(y|Y)(o|O)([!-/:-@[-`{-~]|\s){0,3}$')
}
def check(s):
s = s.split()
if len(s) < 2:
return False
if s[0] in ptn.keys() and ptn[s[0]].search(' '.join(s[1:])):
return True
else:
return False
try:
while True:
if check(input()):
print('CORRECT (maybe)')
else:
print('WRONG!')
except EOFError:
pass
xkumiyu