結果
| 問題 | No.3823 Make 1 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-19 02:51:09 |
| 言語 | C++23(gcc16) (gcc 16.2.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 227 ms / 2,000 ms |
| + 444µs | |
| コード長 | 864 bytes |
| 記録 | |
| コンパイル時間 | 2,405 ms |
| コンパイル使用メモリ | 359,984 KB |
| 実行使用メモリ | 9,848 KB |
| 最終ジャッジ日時 | 2026-11-22 12:43:29 |
| 合計ジャッジ時間 | 4,589 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
const ll mod = 998244353;
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define faster ios::sync_with_stdio(false);cin.tie(nullptr)
int main() {
ll T;
cin >> T;
while(T--){
ll N;
cin >> N;
string s;
cin >> s;
ll cnt=0;
bool flag=false;
rep(i,N){
if(s[i]=='0') cnt+=2;
if(s[i]=='1') cnt+=1;
if(i!=N-1){
if(s[i]==s[i+1]) flag=true;
}
}
if(N==1) flag=true;
if(flag&&cnt%3==1){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
}
return 0;
}