結果
| 問題 | No.2283 Prohibit Three Consecutive |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2026-08-03 22:16:35 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 510 bytes |
| 記録 | |
| コンパイル時間 | 706 ms |
| コンパイル使用メモリ | 96,108 KB |
| 実行使用メモリ | 85,632 KB |
| 最終ジャッジ日時 | 2026-08-03 22:16:45 |
| 合計ジャッジ時間 | 2,532 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 WA * 6 |
ソースコード
from sys import stdin
input = stdin.readline
for _ in range(int(input())):
N = int(input())
S = input().rstrip("\n")
for i in range(N):
if S[i] == "?":
if S[(i-1)%N] != "?" and S[(i+1)%N] != "?" and S[(i-1)%N] == S[(i-2)%N] and S[(i+1)%N] == S[(i+2)%N] and S[(i-1)%N] != S[(i+1)%N]:
print("No")
break
else:
if S[i] == S[(i+1)%N] == S[(i+2)%N]:
print("No")
break
else:
print("Yes")
detteiuu