結果

問題 No.2343 (l+r)/2
ユーザー sepa38sepa38
提出日時 2023-06-09 21:16:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 293 bytes
コンパイル時間 1,307 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 95,544 KB
最終ジャッジ日時 2023-08-30 12:46:01
合計ジャッジ時間 4,481 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,252 KB
testcase_01 AC 649 ms
79,064 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 96 ms
87,468 KB
testcase_05 AC 86 ms
79,248 KB
testcase_06 AC 86 ms
78,056 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 80 ms
78,108 KB
testcase_11 AC 96 ms
90,848 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 99 ms
95,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
  n = int(input())
  a = list(map(int, input().split()))
  o = sum(a)
  k = o - (n - o)
  for i in range(n-1):
    if a[i] != a[i+1]:
      continue
    if a[i]:
      if k > 0:
        k -= 1
    else:
      if k < 0:
        k += 1
  print("No" if k else "Yes")
0