結果

問題 No.2063 ±2^k operations (easy)
ユーザー flygonflygon
提出日時 2022-09-15 22:41:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 78,696 KB
最終ジャッジ日時 2023-08-22 16:29:57
合計ジャッジ時間 3,103 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,328 KB
testcase_01 AC 71 ms
71,212 KB
testcase_02 AC 70 ms
71,240 KB
testcase_03 AC 71 ms
71,440 KB
testcase_04 AC 70 ms
71,324 KB
testcase_05 AC 70 ms
71,292 KB
testcase_06 AC 69 ms
71,328 KB
testcase_07 AC 72 ms
71,068 KB
testcase_08 AC 71 ms
71,332 KB
testcase_09 AC 70 ms
71,208 KB
testcase_10 AC 73 ms
71,292 KB
testcase_11 AC 72 ms
71,484 KB
testcase_12 AC 71 ms
71,296 KB
testcase_13 AC 69 ms
71,104 KB
testcase_14 AC 71 ms
71,332 KB
testcase_15 AC 69 ms
71,332 KB
testcase_16 AC 70 ms
71,284 KB
testcase_17 AC 78 ms
75,628 KB
testcase_18 AC 75 ms
75,672 KB
testcase_19 AC 76 ms
75,956 KB
testcase_20 AC 75 ms
75,776 KB
testcase_21 AC 77 ms
76,160 KB
testcase_22 AC 85 ms
78,508 KB
testcase_23 AC 85 ms
78,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = input()
x = []
cnt = 0
for i,c in enumerate(n):
  if c == "1": cnt += 1
  if i == 0:
    x.append(c)
  else:
    if n[i-1] == c: continue
    else:
      x.append(x)

if cnt == 1: print("No")
elif cnt == 2: print("Yes")
elif len(x) == 1:print('Yes')
elif len(x) == 2:
  print('Yes')
else:
  print('No')
0