結果

問題 No.290 1010
ユーザー FromBooskaFromBooska
提出日時 2023-03-01 19:57:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 474 bytes
コンパイル時間 1,310 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 78,592 KB
最終ジャッジ日時 2023-10-14 23:31:50
合計ジャッジ時間 5,184 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,148 KB
testcase_01 AC 78 ms
71,412 KB
testcase_02 AC 78 ms
71,240 KB
testcase_03 AC 77 ms
70,928 KB
testcase_04 AC 79 ms
71,400 KB
testcase_05 AC 77 ms
71,336 KB
testcase_06 AC 76 ms
70,944 KB
testcase_07 AC 76 ms
71,400 KB
testcase_08 AC 75 ms
71,132 KB
testcase_09 AC 76 ms
71,184 KB
testcase_10 AC 75 ms
71,128 KB
testcase_11 AC 74 ms
71,180 KB
testcase_12 AC 76 ms
71,172 KB
testcase_13 AC 75 ms
71,044 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 76 ms
71,320 KB
testcase_17 AC 74 ms
71,284 KB
testcase_18 AC 73 ms
71,132 KB
testcase_19 AC 76 ms
71,176 KB
testcase_20 AC 95 ms
78,412 KB
testcase_21 AC 92 ms
78,424 KB
testcase_22 WA -
testcase_23 AC 92 ms
78,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 文字列の長さの制約がない
# それならば長さを1とすれば、連続文字があれば常にYES
# 連続文字がなければ101010 or 01010
# N = 1ならNO

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

if N == 1:
    ans = 'NO'
else:
    # 長さは2以上
    test = True
    for i in range(1, N):
        if S[i] == S[i-1]:
            test = False
    if test == True: 
        # つまり101010 or 010101
        ans = 'NO'
    else: 
        ans = 'YES'
print(ans)
0