結果

問題 No.290 1010
ユーザー 学ぶマン
提出日時 2025-04-28 20:43:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 626 ms
コンパイル使用メモリ 81,908 KB
実行使用メモリ 242,072 KB
最終ジャッジ日時 2025-04-28 20:43:18
合計ジャッジ時間 3,608 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.set_int_max_str_digits(0)

from itertools import groupby
def runLengthEncode(S): # list でも str でも OK
    grouped = groupby(S)
    res = []
    for k, v in grouped:
        res.append((k, int(len(list(v)))))
    return res

N = int(input())
S = input()

if len(runLengthEncode(S)) == N: # 01010 or 101010
    print('NO')
else:
    print('YES')
0