結果

問題 No.3061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー chocoruskchocorusk
提出日時 2020-04-01 23:21:27
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
RE  
実行時間 -
コード長 684 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 8,168 KB
最終ジャッジ日時 2023-09-09 20:11:16
合計ジャッジ時間 2,027 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,108 KB
testcase_01 AC 15 ms
7,976 KB
testcase_02 AC 16 ms
7,856 KB
testcase_03 AC 18 ms
7,868 KB
testcase_04 AC 50 ms
7,924 KB
testcase_05 AC 145 ms
7,816 KB
testcase_06 AC 57 ms
7,820 KB
testcase_07 AC 15 ms
7,960 KB
testcase_08 AC 15 ms
8,072 KB
testcase_09 AC 62 ms
7,800 KB
testcase_10 AC 28 ms
7,776 KB
testcase_11 AC 38 ms
7,796 KB
testcase_12 AC 32 ms
7,892 KB
testcase_13 RE -
testcase_14 AC 46 ms
7,796 KB
testcase_15 RE -
testcase_16 AC 36 ms
7,796 KB
testcase_17 AC 55 ms
7,860 KB
testcase_18 AC 35 ms
7,952 KB
testcase_19 AC 16 ms
7,896 KB
testcase_20 AC 15 ms
7,896 KB
testcase_21 AC 15 ms
7,976 KB
testcase_22 AC 15 ms
8,168 KB
testcase_23 AC 19 ms
7,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
n=len(s)
if n<=1:
    print("NO")
    exit()
ok=0
for i in range(n-1):
    for j in range(i, n):
        if (j-i)%2==1:
            continue
        b=0
        dame=0
        for k in range(i, j+1):
            if (k-i)%2==0:
                if s[k]==' ':
                    dame=1
                    break
                b|=(1<<(ord(s[k])-ord("a")))
        for k in range(n):
            if (k-i)%2==0 and k>=i and k<=j:
                continue
            if s[k]==' ':
                continue
            if b&(1<<(ord(s[k])-ord("a"))):
                dame=1
                break
        if dame==0:
            ok=1
if ok:
    print("Yes")
else:
    print("NO")
0