結果
問題 |
No.2063 ±2^k operations (easy)
|
ユーザー |
![]() |
提出日時 | 2022-09-02 21:41:03 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 407 bytes |
コンパイル時間 | 3,087 ms |
コンパイル使用メモリ | 119,680 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-16 02:49:56 |
合計ジャッジ時間 | 3,834 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 1 |
ソースコード
#include <iostream> using namespace std; int main(void){ // Your code here! string s; cin >> s; int cnt = 0; int cnt2 = 1; bool is1 = s[0] == '1'; for(char c : s){ if(c == '1'){ cnt++; } if(is1 != (c == '1')){ is1 = !is1; cnt2++; } } cout << (cnt == 2 || (min(cnt,cnt2) == 2) ? "Yes" : "No") << endl; }