結果

問題 No.2063 ±2^k operations (easy)
ユーザー みここ
提出日時 2022-12-13 19:41:12
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 67,408 KB
最終ジャッジ日時 2025-02-09 11:04:16
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main()
{
    string n;
    cin >> n;
    int k = n.size();
    bool f = true;
    bool g = true;
    int c = 0;
    for (int i = 0; i < k; i++)
    {
        if (n[i] == '1')
        {
            if (!f)
            {
                g = false;
            }
            c++;
        }
        else
        {
            f = false;
        }
    }
    cout << (c == 2 || (c >= 2 && g) ? "Yes" : "No") << endl;
}
0