結果
問題 | No.2063 ±2^k operations (easy) |
ユーザー |
![]() |
提出日時 | 2022-09-02 21:37:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 706 bytes |
コンパイル時間 | 825 ms |
コンパイル使用メモリ | 93,988 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-16 02:38:41 |
合計ジャッジ時間 | 1,656 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <math.h> #include <vector> #include <map> #include <set> #include <deque> #include <queue> #include <cstdio> #include <iomanip> #include <list> #define PI 3.14159265358979323846 #define mod 1000000007 #define pow9 1000000000 #define INF (1 << 30) using namespace std; int main() { string n; cin >> n; int n_cnt = 0; bool flg = true; for (int i = 0; i < n.size(); i++) { if (n[i] == '1') { n_cnt++; } if (i - 1 >= 0 && n[i - 1] == '0' && n[i] == '1') { flg = false; } } if (n_cnt == 1) { cout << "No" << endl; } else if (n_cnt == 2 || flg) { cout << "Yes" << endl; } else { cout << "No" << endl; } }