結果
問題 | No.2283 Prohibit Three Consecutive |
ユーザー | Katsuharuby |
提出日時 | 2023-04-28 22:29:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 879 bytes |
コンパイル時間 | 194 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 85,760 KB |
最終ジャッジ日時 | 2024-04-28 23:58:44 |
合計ジャッジ時間 | 1,975 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 41 ms
51,840 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 61 ms
64,256 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 42 ms
52,096 KB |
testcase_08 | WA | - |
testcase_09 | AC | 49 ms
59,520 KB |
testcase_10 | WA | - |
testcase_11 | AC | 48 ms
59,264 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
ソースコード
def getInt(): return int(input()) def getList(): return list(input().split()) def main(): T = getInt() N = list() S = list() U = list() V = list() ans = [0 for i in range(T)] for i in range(T): N.append(getInt()) S.append(getList()) U.append("0") V.append("1") # print(N) # print(S) for i in range(len(S)): S[i]*=2 S[i] = "".join(S[i]) # print(S) for i in range(len(S)): U[i] = S[i].replace("?","0") V[i] = S[i].replace("?","1") # print(U) # print(V) for i in range(len(S)): if S[i].find("?") != -1: ans[i] = 1 for i in range(len(S)): if ((U[i].find("000") == -1 )or (V[i].find("111") == -1)) and (ans[i] == 1): print("Yes") else: print("No") if __name__ == "__main__": main()