結果
| 問題 | No.3823 Make 1 |
| コンテスト | |
| ユーザー |
テナガザル
|
| 提出日時 | 2026-11-22 13:52:16 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 435 bytes |
| 記録 | |
| コンパイル時間 | 1,236 ms |
| コンパイル使用メモリ | 170,096 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-11-22 13:52:20 |
| 合計ジャッジ時間 | 3,317 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 WA * 5 |
ソースコード
#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'];
now -= cnt[f] + 2 * cnt[1 ^ f];
cout << (now % 3 == 0 ? "Yes" : "No") << endl;
}
int main()
{
int t;
cin >> t;
while (t--) solve();
}
テナガザル