結果

問題 No.290 1010
ユーザー NagisaNagisa
提出日時 2015-10-17 09:02:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 287 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 18,720 KB
最終ジャッジ日時 2023-09-29 13:36:51
合計ジャッジ時間 1,906 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,740 KB
testcase_01 AC 13 ms
7,832 KB
testcase_02 AC 13 ms
7,756 KB
testcase_03 AC 13 ms
7,788 KB
testcase_04 AC 13 ms
7,904 KB
testcase_05 AC 13 ms
7,792 KB
testcase_06 AC 13 ms
7,864 KB
testcase_07 AC 13 ms
7,784 KB
testcase_08 AC 12 ms
7,840 KB
testcase_09 AC 13 ms
7,788 KB
testcase_10 AC 13 ms
7,908 KB
testcase_11 AC 12 ms
7,816 KB
testcase_12 AC 12 ms
7,964 KB
testcase_13 AC 12 ms
7,844 KB
testcase_14 AC 13 ms
7,908 KB
testcase_15 AC 13 ms
7,920 KB
testcase_16 AC 13 ms
7,788 KB
testcase_17 AC 13 ms
7,740 KB
testcase_18 AC 13 ms
7,784 KB
testcase_19 AC 12 ms
7,740 KB
testcase_20 AC 59 ms
18,596 KB
testcase_21 AC 56 ms
18,552 KB
testcase_22 AC 56 ms
18,720 KB
testcase_23 AC 56 ms
18,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = [str(x) for x in input()]

if N == 1:
    print("NO")
elif N == 2:
    if len(set(S)) == 1:
        print("YES")
    else:
        print("NO")
elif N == 3:
    if S[0] == S[1] or S[1] == S[2]:
        print("YES")
    else:
        print("NO")
else:
    print("YES")
0