結果
問題 |
No.291 黒い文字列
|
ユーザー |
![]() |
提出日時 | 2025-04-16 00:14:19 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 556 bytes |
コンパイル時間 | 508 ms |
コンパイル使用メモリ | 81,752 KB |
実行使用メモリ | 57,688 KB |
最終ジャッジ日時 | 2025-04-16 00:15:28 |
合計ジャッジ時間 | 2,400 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 WA * 8 |
ソースコード
s = input().strip() n = len(s) used = [False] * n target = ['K', 'U', 'R', 'O', 'I'] count = 0 while True: ptr = 0 indices = [] for c in target: found = False while ptr < n: if not used[ptr] and (s[ptr] == c or s[ptr] == '?'): indices.append(ptr) used[ptr] = True ptr += 1 found = True break ptr += 1 if not found: break if len(indices) == 5: count += 1 else: break print(count)