結果
問題 |
No.2343 (l+r)/2
|
ユーザー |
![]() |
提出日時 | 2023-06-09 22:01:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,216 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 13,344 KB |
最終ジャッジ日時 | 2025-01-02 03:05:20 |
合計ジャッジ時間 | 2,276 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 WA * 7 |
ソースコード
# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1") # from bisect import * # from collections import * # from heapq import * # from itertools import * # from math import * # from datetime import * # from decimal import* # from string import ascii_lowercase,ascii_uppercase # import numpy as np import sys import os # sys.setrecursionlimit(10**6) INF = 10**18 MOD = 998244353 # MOD = 10**9 + 7 File = open("input.txt", "r") if os.path.exists("input.txt") else sys.stdin def input(): return File.readline().replace("\n", "") # /////////////////////////////////////////////////////////////////////////// def RLE(s): result = [] count = 1 for i in range(1, len(s)): if s[i] == s[i - 1]: count += 1 else: result.append((s[i - 1], count)) count = 1 result.append((s[-1], count)) return result T = int(input()) for _ in range(T): N = int(input()) A = "".join(input().split()) rle = RLE(A) if len(rle) % 2 == 0: print("Yes") else: res = 0 for i in range(len(rle)): if i % 2: if rle[i][1] > 1: res = 1 print("Yes" if res else "No")