結果
問題 | No.1367 文字列門松 |
ユーザー | mesame3993 |
提出日時 | 2021-12-09 01:44:47 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 652 bytes |
コンパイル時間 | 697 ms |
コンパイル使用メモリ | 87,128 KB |
実行使用メモリ | 79,368 KB |
最終ジャッジ日時 | 2023-09-23 12:54:14 |
合計ジャッジ時間 | 4,969 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 69 ms
71,196 KB |
testcase_01 | AC | 68 ms
71,176 KB |
testcase_02 | AC | 69 ms
71,300 KB |
testcase_03 | AC | 69 ms
71,064 KB |
testcase_04 | AC | 72 ms
71,044 KB |
testcase_05 | WA | - |
testcase_06 | RE | - |
testcase_07 | WA | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | AC | 70 ms
71,140 KB |
testcase_16 | AC | 71 ms
71,196 KB |
testcase_17 | AC | 72 ms
71,144 KB |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | AC | 69 ms
70,964 KB |
testcase_21 | AC | 69 ms
71,380 KB |
testcase_22 | AC | 70 ms
71,164 KB |
testcase_23 | RE | - |
testcase_24 | AC | 70 ms
71,076 KB |
testcase_25 | RE | - |
testcase_26 | AC | 69 ms
71,072 KB |
ソースコード
def main(): from sys import stdin readline = stdin.readline s = readline()[:-1] n = len(s) t = 'kadomatsu' if n > len(t): print('No') exit() arr_t = [x for x in t] delta = [] for i in range(n): if s[i] in arr_t: delta.append(arr_t.index(s[i])) if arr_t.index(s[i]) >= 1 and s[i] != 'a': arr_t.remove('a') arr_t.remove(s[i]) else: print('No') exit() flag = (delta == list(sorted(delta))) print('Yes' if flag else 'No') if __name__ == "__main__": import sys readline = sys.stdin.readline def error(*args, end='\n'): print(*args, end=end, file=sys.stderr) main()