/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 1ms 532.0 KiB
#3 Wrong Answer 2ms 532.0 KiB

Code

#include "bits/stdc++.h"
//#include <bits/stdc++.h>
using namespace std;

#define int long long
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define fr(i,a,b) for(int i = a; i < b; i++)
#define in(v,n)  vi v(n); fr(i,0,n) cin>>v[i];
#define yes cout<<"YES"<<'\n'
#define no cout<<"NO"<<'\n'
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);

typedef vector<int> vi;

void solve()
{
	int n; cin >> n;
	string s,p; cin >> s >> p;

	int oneCount = 0;
	int zeroCount = 0;

	fr(i,0,n)
	{
		if(p[i]=='1')
		{
			oneCount++;
		}
		else
		{
			zeroCount++;
		}
	}

	if (n <= 1)
	{
		no;
	}
	else if (!oneCount || !zeroCount)
	{
		no;
	}
	else if ( oneCount == n || zeroCount == n)
	{
		no;
	}
	else
	{
		yes;
	}

    
}

int32_t main() 
{
    fastio;

    int t; cin >> t;
    while(t--) solve();

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1233 B. Make Binary Strings Equal
Contest
Happy New Year 2026
Language
C++17 (G++ 13.2.0)
Submit At
2026-01-06 15:08:26
Judged At
2026-01-06 15:08:28
Judged By
Score
0
Total Time
2ms
Peak Memory
532.0 KiB