結果
問題 |
No.2063 ±2^k operations (easy)
|
ユーザー |
![]() |
提出日時 | 2022-09-02 21:38:57 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 395 bytes |
コンパイル時間 | 4,211 ms |
コンパイル使用メモリ | 118,656 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-16 02:45:18 |
合計ジャッジ時間 | 5,566 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 2 |
ソースコード
#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 << ((min(cnt,cnt2) == 2) ? "Yes" : "No") << endl; }