結果

問題 No.3061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー chocoruskchocorusk
提出日時 2020-04-01 22:51:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 819 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 8,228 KB
最終ジャッジ日時 2023-09-09 19:36:22
合計ジャッジ時間 1,872 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,068 KB
testcase_01 AC 16 ms
7,884 KB
testcase_02 AC 17 ms
7,808 KB
testcase_03 AC 20 ms
7,848 KB
testcase_04 AC 63 ms
7,832 KB
testcase_05 AC 194 ms
7,760 KB
testcase_06 AC 73 ms
7,756 KB
testcase_07 AC 16 ms
8,004 KB
testcase_08 AC 17 ms
8,228 KB
testcase_09 AC 24 ms
7,836 KB
testcase_10 AC 19 ms
7,944 KB
testcase_11 AC 25 ms
7,852 KB
testcase_12 AC 21 ms
7,940 KB
testcase_13 RE -
testcase_14 AC 21 ms
7,860 KB
testcase_15 RE -
testcase_16 AC 22 ms
7,848 KB
testcase_17 AC 26 ms
7,740 KB
testcase_18 AC 19 ms
7,884 KB
testcase_19 AC 16 ms
7,860 KB
testcase_20 AC 16 ms
7,816 KB
testcase_21 AC 16 ms
7,828 KB
testcase_22 AC 16 ms
8,040 KB
testcase_23 AC 17 ms
7,948 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
                if ord(s[k])-ord("a")<0:
                    continue
                b|=(1<<(ord(s[k])-ord("a")))
        if dame==1:
            continue
        for k in range(n):
            if (k-i)%2==0 and k>=i and k<=j:
                continue
            if s[k]==' ' or ord(s[k])-ord("a")<0:
                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