結果
問題 | No.2343 (l+r)/2 |
ユーザー | lloyz |
提出日時 | 2023-06-10 01:05:28 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 615 ms / 2,000 ms |
コード長 | 1,233 bytes |
コンパイル時間 | 400 ms |
コンパイル使用メモリ | 87,020 KB |
実行使用メモリ | 95,320 KB |
最終ジャッジ日時 | 2023-08-30 15:55:13 |
合計ジャッジ時間 | 3,884 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 79 ms
71,316 KB |
testcase_01 | AC | 615 ms
78,736 KB |
testcase_02 | AC | 157 ms
78,404 KB |
testcase_03 | AC | 332 ms
81,844 KB |
testcase_04 | AC | 95 ms
89,044 KB |
testcase_05 | AC | 87 ms
79,392 KB |
testcase_06 | AC | 86 ms
78,012 KB |
testcase_07 | AC | 97 ms
77,420 KB |
testcase_08 | AC | 103 ms
77,996 KB |
testcase_09 | AC | 98 ms
78,184 KB |
testcase_10 | AC | 86 ms
77,812 KB |
testcase_11 | AC | 95 ms
90,888 KB |
testcase_12 | AC | 90 ms
87,088 KB |
testcase_13 | AC | 89 ms
82,232 KB |
testcase_14 | AC | 103 ms
95,320 KB |
ソースコード
for _ in range(int(input())): n = int(input()) A = list(map(int, input().split())) B = [A[0]] for i in range(1, n): if A[i] == A[i - 1]: continue B.append(A[i]) if B[0] == 1: if len(B) % 2 == 0: print("Yes") elif len(B) >= 9: print("Yes") else: seq_0 = False cnt = 0 for i in range(n): if A[i] == 1: cnt = 0 else: cnt += 1 if cnt > 1: seq_0 = True break if seq_0: print("Yes") else: print("No") else: if len(B) % 2 == 0: print("Yes") elif len(B) >= 9: print("Yes") else: seq_1 = False cnt = 0 for i in range(n): if A[i] == 0: cnt = 0 else: cnt += 1 if cnt > 1: seq_1 = True break if seq_1: print("Yes") else: print("No")