結果
| 問題 | No.2063 ±2^k operations (easy) |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 20:25:04 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 60 ms / 2,000 ms |
| コード長 | 662 bytes |
| 記録 | |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 96,108 KB |
| 実行使用メモリ | 82,924 KB |
| 最終ジャッジ日時 | 2026-07-07 09:09:16 |
| 合計ジャッジ時間 | 3,308 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
def main():
s = input().strip()
cnt_1 = s.count('1')
# Check condition A: exactly two '1's and non-consecutive
if cnt_1 == 2:
first = s.find('1')
second = s.find('1', first + 1)
if second != first + 1:
print("Yes")
return
# Check condition B: contiguous '1's followed by '0's only
pos = 0
while pos < len(s) and s[pos] == '1':
pos += 1
rest = s[pos:]
condition_b = '1' not in rest
if condition_b:
if cnt_1 == 1:
print("No")
else:
print("Yes")
else:
print("No")
if __name__ == "__main__":
main()
lam6er