結果

問題 No.290 1010
ユーザー nohakai3nohakai3
提出日時 2022-11-17 12:49:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 5,000 ms
コード長 210 bytes
コンパイル時間 594 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 105,748 KB
最終ジャッジ日時 2023-10-19 05:09:05
合計ジャッジ時間 2,863 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,340 KB
testcase_01 AC 40 ms
53,340 KB
testcase_02 AC 39 ms
53,340 KB
testcase_03 AC 39 ms
53,340 KB
testcase_04 AC 39 ms
53,340 KB
testcase_05 AC 39 ms
53,340 KB
testcase_06 AC 38 ms
53,340 KB
testcase_07 AC 38 ms
53,340 KB
testcase_08 AC 38 ms
53,340 KB
testcase_09 AC 39 ms
53,340 KB
testcase_10 AC 40 ms
53,340 KB
testcase_11 AC 39 ms
53,340 KB
testcase_12 AC 38 ms
53,340 KB
testcase_13 AC 38 ms
53,340 KB
testcase_14 AC 38 ms
53,340 KB
testcase_15 AC 39 ms
53,340 KB
testcase_16 AC 39 ms
53,340 KB
testcase_17 AC 39 ms
53,340 KB
testcase_18 AC 39 ms
53,340 KB
testcase_19 AC 39 ms
53,340 KB
testcase_20 AC 83 ms
101,980 KB
testcase_21 AC 83 ms
101,980 KB
testcase_22 AC 92 ms
105,748 KB
testcase_23 AC 82 ms
101,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
s=list(input())

for i in range(n-1):
    if s[i]==s[i+1]:
        print("YES")
        exit()


for i in range(n-3):
    if s[i:i+2]==s[i+2:i+4]:
        print("YES")
        exit()

print("NO")
0