結果
| 問題 |
No.2063 ±2^k operations (easy)
|
| コンテスト | |
| ユーザー |
QCFium
|
| 提出日時 | 2022-09-02 21:23:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 420 bytes |
| コンパイル時間 | 1,505 ms |
| コンパイル使用メモリ | 167,720 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-16 02:11:59 |
| 合計ジャッジ時間 | 2,321 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
int ri() {
int n;
scanf("%d", &n);
return n;
}
int main() {
std::string s;
std::cin >> s;
int one_cnt = std::count(s.begin(), s.end(), '1');
int cnt = 0;
bool prev = false;
for (auto c : s) {
if (prev && c == '0') cnt++;
prev = c == '1';
}
if (prev) cnt++;
bool result = (cnt == 1 && one_cnt > 1) || (cnt == 2 && one_cnt == 2);
puts(result ? "Yes" : "No");
return 0;
}
QCFium