結果
| 問題 |
No.2063 ±2^k operations (easy)
|
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2022-09-02 21:25:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 571 bytes |
| コンパイル時間 | 307 ms |
| コンパイル使用メモリ | 82,128 KB |
| 実行使用メモリ | 70,696 KB |
| 最終ジャッジ日時 | 2024-11-16 02:14:41 |
| 合計ジャッジ時間 | 1,949 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 1 |
ソースコード
def Run_Length_Encoding(S):
""" Run Length 圧縮
S: 列
"""
if not S:
return []
R=[[S[0],1]]
for i in range(1,len(S)):
if R[-1][0]==S[i]:
R[-1][1]+=1
else:
R.append([S[i],1])
return R
#==================================================
def solve():
N=input()
R=Run_Length_Encoding(N)
if R==[["1",1],["0",len(N)-1]] or R==[["1",1]]:
return False
if len(R)==2 or N.count("1")==2:
return True
else:
return False
print("Yes" if solve() else "No")
Kazun