結果
| 問題 | No.3823 Make 1 |
| コンテスト | |
| ユーザー |
テナガザル
|
| 提出日時 | 2026-11-22 13:54:29 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 528 bytes |
| 記録 | |
| コンパイル時間 | 1,038 ms |
| コンパイル使用メモリ | 172,508 KB |
| 実行使用メモリ | 9,924 KB |
| 最終ジャッジ日時 | 2026-11-22 13:54:32 |
| 合計ジャッジ時間 | 2,904 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 WA * 7 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void solve()
{
int n;
string s;
cin >> n >> s;
int now = 1, f = 1;
while (now < n)
{
now <<= 1;
f ^= 1;
}
now <<= 1;
f ^= 1;
int cnt[2] = {0, 0};
for (auto c : s) ++cnt[c - '0'];
int check = 0;
for (int i = 0; i < n - 1; ++i) if (s[i] == s[i + 1]) check = 1;
now -= cnt[f] + 2 * cnt[1 ^ f];
cout << (now % 3 == 0 && check ? "Yes" : "No") << endl;
}
int main()
{
int t;
cin >> t;
while (t--) solve();
}
テナガザル