結果
問題 |
No.291 黒い文字列
|
ユーザー |
![]() |
提出日時 | 2025-03-31 17:35:24 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 639 bytes |
コンパイル時間 | 171 ms |
コンパイル使用メモリ | 82,748 KB |
実行使用メモリ | 59,064 KB |
最終ジャッジ日時 | 2025-03-31 17:36:23 |
合計ジャッジ時間 | 2,457 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 WA * 8 |
ソースコード
s = list(input().strip()) n = len(s) used = [False] * n count = 0 while True: pos = [] current_pos = -1 for target in 'KUROI': found = False for i in range(current_pos + 1, n): if not used[i] and (s[i] == target or s[i] == '?'): if s[i] == '?': s[i] = target # Replace '?' with the target character used[i] = True pos.append(i) current_pos = i found = True break if not found: break if len(pos) == 5: count += 1 else: break print(count)