結果

問題 No.290 1010
ユーザー titiatitia
提出日時 2022-10-10 00:01:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 292 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 10,752 KB
実行使用メモリ 10,228 KB
最終ジャッジ日時 2023-09-06 02:29:00
合計ジャッジ時間 2,157 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,816 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 16 ms
8,252 KB
testcase_03 AC 15 ms
7,880 KB
testcase_04 AC 15 ms
7,876 KB
testcase_05 AC 15 ms
8,264 KB
testcase_06 AC 15 ms
8,184 KB
testcase_07 AC 15 ms
8,108 KB
testcase_08 AC 15 ms
8,108 KB
testcase_09 AC 15 ms
8,112 KB
testcase_10 AC 15 ms
8,172 KB
testcase_11 AC 15 ms
8,052 KB
testcase_12 AC 15 ms
7,852 KB
testcase_13 AC 15 ms
7,884 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 15 ms
8,084 KB
testcase_17 AC 15 ms
8,272 KB
testcase_18 AC 16 ms
8,076 KB
testcase_19 AC 15 ms
8,264 KB
testcase_20 AC 18 ms
10,224 KB
testcase_21 AC 18 ms
10,060 KB
testcase_22 AC 225 ms
10,228 KB
testcase_23 AC 18 ms
10,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

for i in range(N-4):
    if S[i:i+2]==S[i+2:i+4]:
        print("YES")
        exit()

for i in range(N-6):
    if S[i:i+3]==S[i+3:i+6]:
        print("YES")
        exit()


print("NO")
0