Problem: 2061D - Kevin and Numbers
Language: c++20 

Code 1:
#include <bits/stdc++.h>
using namespace std;
namespace A
{
    const long long N = 3e5 + 20, M = 998244353;
#define eps 1e-12
#define int long long
#define ll long long
#define all(x) x.begin(), x.end()
#define endl '\n'
#define ls (p << 1)
#define rs ((p << 1) | 1)
#define f1 first
#define pb push_back
#define f2 second
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout << fixed << setprecision(2);
}
using namespace A;
//__int128
int read()
{
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    x *= f;
    return x;
}
void write(int x)
{
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    if (x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}
/*task1
{
每日错题
}*/
/*task2
{
div2 D
做到80%概率做E,10场<=20%概率降级
0 1
50%
提升一个阶段后尝试学习10个新算法
G  or 牛客博弈论专题 10题
}*/
int t, n, m;
signed main()
{
    IOS;
    cin >> t;
    while (t--)
    {
        cin >> n >> m;
        int x;
        priority_queue<pair<int, int>> q1, q2;
        for (int i = 1; i <= n; i++)
        {
            cin >> x;
            q1.push({x, 1});
        }
        for (int i = 1; i <= m; i++)
        {
            cin >> x;
            q2.push({x, 1});
        }
        int ok = 1;
        while (q1.size() && q2.size())
        {
            auto [p1, t1] = q1.top();
            auto [p2, t2] = q2.top();
            q1.pop(), q2.pop();
            if (p1 == p2)
            {
                if (t1 == t2)
                    continue;
                else if (t1 > t2)
                {
                    q1.push({p1, t1 - t2});
                }
                else
                    q2.push({p2, t2 - t1});
            }
            else if (p1 < p2)
            {
                if (p2 % 2 == 1)
                {
                    q2.push({p2 / 2, t2});
                    q2.push({p2 / 2 + 1, t2});
                    q1.push({p1, t1});
                }
                else
                {
                    int u = t2;
                    while (p2 / 2 >= p1 && p2 % 2 == 0)
                    {
                        p2 /= 2;
                        u *= 2;
                    }
                    q2.push({p2, u});
                    q1.push({p1, t1});
                }
            }
            else
            {
                ok = 0;
                break;
            }
        }
        if (q1.size() || q2.size())
            ok = 0;
        cout << (ok ? "YES\n" : "NO\n");
    }
    return false;
}

Code 2:
#include <bits/stdc++.h>
using namespace std;
namespace A
{
    const long long N = 3e5 + 20, M = 998244353;
#define eps 1e-12
#define int long long
#define ll long long
#define all(x) x.begin(), x.end()
#define endl '\n'
#define ls (p << 1)
#define rs ((p << 1) | 1)
#define f1 first
#define pb push_back
#define f2 second
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout << fixed << setprecision(2);
}
using namespace A;
//__int128
int read()
{
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    x *= f;
    return x;
}
void write(int x)
{
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    if (x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}
/*task1
{
每日错题
}*/
/*task2
{
div2 D
做到80%概率做E,10场<=20%概率降级
0 1
50%
提升一个阶段后尝试学习10个新算法
G  or 牛客博弈论专题 10题
}*/
int t, n, m;
signed main()
{
    IOS;
    cin >> t;
    while (t--)
    {
        cin >> n >> m;
        int x;
        priority_queue<int> q1, q2;
        for (int i = 1; i <= n; i++)
        {
            cin >> x;
            q1.push(x);
        }
        for (int i = 1; i <= m; i++)
        {
            cin >> x;
            q2.push(x);
        }
        int ok = 1;
        while (q1.size() && q2.size())
        {
            int p1 = q1.top(), p2 = q2.top();
            q1.pop(), q2.pop();
            if(q2.size()>q1.size())
            {
                ok=0;
                break;
            }
            if (p1 == p2)
            {
                continue;
            }
            else if (p1 < p2)
            {
                int u = p2 / 2, u1 = p2 - u;
                q2.push(u), q2.push(u1), q1.push(p1);
            }
            else
            {
                ok = 0;
                break;
            }
        }
        if (q1.size() || q2.size())
            ok = 0;
        cout << (ok ? "YES\n" : "NO\n");
    }
    return false;
}

Answer: 2