結果

問題 No.3061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー googol_S0googol_S0
提出日時 2020-03-11 22:45:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,152 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 13,060 KB
最終ジャッジ日時 2023-08-10 04:42:26
合計ジャッジ時間 4,073 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
13,060 KB
testcase_01 AC 19 ms
8,524 KB
testcase_02 AC 19 ms
8,464 KB
testcase_03 AC 222 ms
8,492 KB
testcase_04 AC 19 ms
8,604 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter as co
from sys import exit
S=input()
L_l=list(S)
L_s=list(set(list(S)))
if ' ' in L_l:
  del L_l[L_l.index(' ')]
if ' ' in L_s:
  del L_s[L_s.index(' ')]
if len(L_s)==0:
  print('NO')
  exit()
C=co(L_l)
V=list(C.values())
V.sort()
if C[S[-1]]==1:
  if len(L_s)==1:
    print('NO')
    exit()
  elif V[1]==1:
    print('Yes')
    exit()
  else:
    del L_s[L_s.index(S[-1])]
    del L_l[L_l.index(S[-1])]
    S=S[0:len(S)-1]
space=list()
b=''
X=-1
Y=True
Z=True
for i in range(2**len(L_s)):
  X=-1
  Y=True
  Z=True
  space=list()
  space.append(' ')
  b=str(bin(i))
  b=b[2:len(b)]
  b='0000000000000000000000000000000'+b
  b=b[-len(L_s):]
  for j in range(len(L_s)):
    if b[j]=='0':
      space.append(L_s[j])
  for j in range(len(S)):
    if S[j] in space:
      if Y:
        if X==-1:
          True
        elif X%2==1:
          X=X+1
        else:
          Y=False
    else:
      if Y:
        if X==-1:
          X=1
        elif X%2==0:
          X=X+1
        else:
          Z=False
          break
      else:
        Z=False
        break
  if X>=2:
    if Z:
      print('Yes')
      exit()
print('NO')
0