結果

問題 No.2343 (l+r)/2
ユーザー rotti_coder
提出日時 2023-06-09 21:14:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,336 KB
実行使用メモリ 95,056 KB
最終ジャッジ日時 2025-01-02 01:58:51
合計ジャッジ時間 3,246 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 1 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
for i in range(n):
  t = int(input())
  a = list(map(int,input().split()))
  if sum(a) == t//2 and t % 2 == 0:
    print("Yes")
    continue
  mae = -1
  if sum(a) < t//2:
    mokuteki = 0
  else:
    mokuteki = 1
  count = 0
  for ipp in range(t):
    if a[ipp] == mae and a[ipp] == mokuteki:
      count += 1
      print(count)
    else:
      mae = a[ipp]
  if abs((t-sum(a))-sum(a)) <= count:
    print("Yes")
  else:
    print("No")
0