結果
| 問題 |
No.8061 uxs hxixtya pyuyn ixc hyixa kxuyn
|
| コンテスト | |
| ユーザー |
googol_S0
|
| 提出日時 | 2020-03-11 22:45:38 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,152 bytes |
| コンパイル時間 | 320 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 21,376 KB |
| 最終ジャッジ日時 | 2024-11-16 04:23:55 |
| 合計ジャッジ時間 | 8,270 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 15 RE * 2 TLE * 2 |
ソースコード
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')
googol_S0