/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

//! In The Name Of Allah

/*********************************************************************\
*!          |       *        |       | ___  | @                       |
*!          |      * *       |       |  |   |  @                      |
*!          |     *   *      |       |  |   |   @                     |
*!          |    *******     |-------|  |   |    @                    |
*! |*       |   *       *    |       |  |   |   @                     |
*! |        |  *         *   |       |  |   |  @                      |
*! |________| *           *  |       | ___  | @                       |
*!                                                                    |
*!  codeforces = Jahid__Noob                                          |
*!  mail =  [email protected]                                       |
*!  IIT,Jahangirnagar University(51)                                  |
*!                                                                    |
**********************************************************************/

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

#define int long long
#define endl '\n'
#define pb push_back
#define pob pop_back
#define make M
#define F first
#define S second
#define all(s) (s).begin(), (s).end()
#define rall(s) s.rbegin(), s.rend()
#define sz(x) (int)x.size()
#define mem(a, b) memset(a, b, sizeof(a))
#define cnt_bit(x) __builtin_popcountll(x)
#define getbit(n, i) (((n) & (1LL << (i))) != 0)
#define msb(x) 64 - __builtin_clzll(x)
#define setbit(n, i) ((n) |= (1LL << (i)))
#define hoise cout << "Hoise" << endl;
#define tham getchar();
#define TxtIO                         \
    freopen("sample.in", "r", stdin); \
    freopen("sample.out", "w", stdout);
#define Fokinnir_moto_kaj_koris_na \
    ios_base::sync_with_stdio(0);  \
    cin.tie(0);                    \
    cout.tie(0);
#define py cout << "YES" << endl
#define pn cout << "NO" << endl
#define PI acos(-1)
#define sum_of(A) accumulate(all(A), 0ll)
#define max_of(A) *max_element(all(A))
#define min_of(A) *min_element(all(A))

typedef long long ll;
typedef double dl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef array<int,3> tu;

ll gcd(ll a, ll b) { return __gcd(a, b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }

/*
auto Goriber_function = [&] (int m) -> int{

};
*/

const ll oo = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 123;

void Goriber_solve()
{
    int n;
    cin >> n;
    string a,b;
    cin >> a >> b;
    if(a == b){
        py;
        return;
    }
    for(int i = 0; i + 1 < n; i++){
        if(a[i] != b[i]){
            if(b[i] == '1'){
                a[i] = '1';
                a[i+1] = '0';
            }
            else{
                a[i] = '0';
                a[i+1] = '1';
            }
        }
    }
    if(a == b){
        py;
        return;
    }
    pn;
}

signed main()
{
    Fokinnir_moto_kaj_koris_na
    int _ = 1,tc = 0;
    cin >> _;
    while (_--)
    {
        //cout<<"Case "<<++tc<<": ";
        Goriber_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 14:48:00
Judged At
2026-01-06 14:48:01
Judged By
Score
0
Total Time
2ms
Peak Memory
536.0 KiB