ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <iostream>

#include <string>

#include <cmath>

#include <vector>

#include <map>

#include <set>

#include <queue>

#include <utility>

#include <algorithm>

#define ll long long

#define st string

#define ld long double

#define pb push_back

#define mk make_pair

#define ff first

#define ss second

using namespace std;









void solve() {

	st s; cin >> s;

	for (int i = 0; i < s.size(); i++) {

		int p = i, mx = s[i];

		for (int j = i + 1; j < min(10, (int)s.size()); j++) {

			if (s[j] - (j - i) > mx) {

				mx = s[j] - (j - i);

				p = j;

			}

		}

		while (p != i) {

			swap(--s[p], s[p-1]);

			p--;

		}

	}

	cout << s << "\n";

}



int main() {

	ios::sync_with_stdio(false);

	cin.tie(nullptr); cout.tie(nullptr);

	int tt = 1;

	cin >> tt;

	while (tt--) {

		solve();

	}

	cout << "\n";

	return 0;

}



Submission (verdict: Accepted):
#include <iostream>

#include <string>

#include <cmath>

#include <vector>

#include <map>

#include <set>

#include <queue>

#include <utility>

#include <algorithm>

#define ll long long

#define st string

#define ld long double

#define pb push_back

#define mk make_pair

#define ff first

#define ss second

using namespace std;









void solve() {

	st s; cin >> s;

	for (int i = 0; i < s.size(); i++) {

		int p = i, mx = s[i];

		for (int j = i + 1; j < min(i + 10, (int)s.size()); j++) {

			if (s[j] - (j - i) > mx) {

				mx = s[j] - (j - i);

				p = j;

			}

		}

		while (p != i) {

			swap(--s[p], s[p-1]);

			p--;

		}

	}

	cout << s << "\n";

}



int main() {

	ios::sync_with_stdio(false);

	cin.tie(nullptr); cout.tie(nullptr);

	int tt = 1;

	cin >> tt;

	while (tt--) {

		solve();

	}

	cout << "\n";

	return 0;

}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 4):
#include <iostream>

#include <string>

#include <cmath>

#include <vector>

#include <map>

#include <set>

#include <queue>

#include <utility>

#include <algorithm>

#define ll long long

#define st string

#define ld long double

#define pb push_back

#define mk make_pair

#define ff first

#define ss second

using namespace std;









void solve() {

	st s; cin >> s;

	while (!(is_sorted(s.begin(), s.end(), greater<ll>()))) {

		st s1 = s;

		for (int i = 1; i < s.size(); i++) {

			if (s[i] == '0') continue;

			st s2 = s;

			s2[i] = char(int(s2[i]) - 1);

			swap(s2[i-1], s2[i]);

			s1 = max(s1, s2);

		}

		if (s == s1) break;

		else s = max(s, s1);

		

		//cout << s << "\n";

		

	}

	cout << s << "\n";

}



int main() {

	ios::sync_with_stdio(false);

	cin.tie(nullptr); cout.tie(nullptr);

	int tt = 1;

	cin >> tt;

	while (tt--) {

		solve();

	}

	cout << "\n";

	return 0;

}



Submission (verdict: Wrong answer on test 3):
#include <iostream>

#include <string>

#include <cmath>

#include <vector>

#include <map>

#include <set>

#include <queue>

#include <utility>

#include <algorithm>

#define ll long long

#define st string

#define ld long double

#define pb push_back

#define mk make_pair

#define ff first

#define ss second

using namespace std;









void solve() {

	st s; cin >> s;

	for (int i = 0; i < s.size(); i++) {

		int p = i, mx = s[i];

		for (int j = i + 1; j < min(10, (int)s.size()); j++) {

			if (s[j] - (j - i) > mx) {

				mx = s[j] - (j - i);

				p = j;

			}

		}

		while (p != i) {

			swap(--s[p], s[p-1]);

			p--;

		}

	}

	cout << s << "\n";

}



int main() {

	ios::sync_with_stdio(false);

	cin.tie(nullptr); cout.tie(nullptr);

	int tt = 1;

	cin >> tt;

	while (tt--) {

		solve();

	}

	cout << "\n";

	return 0;

}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)


Submission (verdict: Time limit exceeded on test 2):
#include <algorithm>
#include <bits/stdc++.h>
#include <fstream> //includes file stream: write to files and open and use data from files
#include <iostream>
#include <iterator>
#include <map>    //includes map datatype
#include <math.h> //includes math operations like min, max, absolute value, power
#include <queue>
#include <set>
#include <stack>
#include <string> //includes string datatype
#include <vector> //includes vector datastructre: a list of variable size
using namespace std;
using ll = long long;
 
ifstream fin("x.in");   // opens file x.in for reading
ofstream fout("x.out"); // opens or creates file x.out for writing
 
// minus is 1 plus is 0
 
void solve() {
  string n;
  cin >> n;
  bool check = false;

  ll size = n.size();
  ll sum = 0;
  ll twos = 0;
  ll threes = 0;

  for (ll i = 0; i < size; ++i) {
    char sub = n[i];
    sum += (ll)sub - 48;
    if ((ll)sub - 48 == 2) {
      ++twos;
    } else if ((ll)sub - 48 == 3) {
      ++threes;
    }
  }

if (sum % 9 == 0) {
    cout << "YES" << "\n";
  } else {
    while (sum % 9 != 0) {
      if (twos == 0 && threes == 0 && sum % 9 != 0) {
        cout << "NO" << "\n";
        break;
      } else if ((sum + 2) % 9 == 0 && twos != 0) {
        cout << "YES" << "\n";
        break; 
      } else if ((sum + 6) % 9 == 0 && threes != 0) {
        cout << "YES" << "\n";
        break;
      } else if ((sum + 2) % 9 != 0 && threes != 0) {
        sum += 6;
        threes--;
      } else if (threes == 0 && twos != 0) {
        sum += 2;
        twos--;
      }
  }
  }
}

int main() {

  ll t;
  cin >> t;
  while(t--) {
  solve();
  }
 
  return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

Previous submission (verdict: Time limit exceeded on test 2):
#include <algorithm>
#include <bits/stdc++.h>
#include <fstream> //includes file stream: write to files and open and use data from files
#include <iostream>
#include <iterator>
#include <map>    //includes map datatype
#include <math.h> //includes math operations like min, max, absolute value, power
#include <queue>
#include <set>
#include <stack>
#include <string> //includes string datatype
#include <vector> //includes vector datastructre: a list of variable size
using namespace std;
using ll = long long;
 
ifstream fin("x.in");   // opens file x.in for reading
ofstream fout("x.out"); // opens or creates file x.out for writing
 
// minus is 1 plus is 0
 
void solve() {
  string n;
  cin >> n;
  bool check = false;

  ll size = n.size();
  ll sum = 0;
  ll twos = 0;
  ll threes = 0;

  for (ll i = 0; i < size; ++i) {
    char sub = n[i];
    sum += (ll)sub - 48;
    if ((ll)sub - 48 == 2) {
      ++twos;
    } else if ((ll)sub - 48 == 3) {
      ++threes;
    }
  }

if (sum % 9 == 0) {
    cout << "YES" << "\n";
    return;
  } else {
    while (sum % 9 != 0) {
      if (twos == 0 && threes == 0 && sum % 9 != 0) {
        cout << "NO" << "\n";
        return;
      } else if ((sum + 2) % 9 == 0 && twos != 0) {
        cout << "YES" << "\n";
        return; 
      } else if ((sum + 6) % 9 == 0 && threes != 0) {
        cout << "YES" << "\n";
        return;
      } else if ((sum + 2) % 9 != 0 && threes != 0) {
        sum += 6;
        threes--;
      } else if (threes == 0 && twos != 0) {
        sum += 2;
        twos--;
      }
  }
  }
}

int main() {

  ll t;
  cin >> t;
  while(t--) {
  solve();
  }
 
  return 0;
}

Submission (verdict: Accepted):
#include <algorithm>
#include <bits/stdc++.h>
#include <fstream> //includes file stream: write to files and open and use data from files
#include <iostream>
#include <iterator>
#include <map>    //includes map datatype
#include <math.h> //includes math operations like min, max, absolute value, power
#include <queue>
#include <set>
#include <stack>
#include <string> //includes string datatype
#include <vector> //includes vector datastructre: a list of variable size
using namespace std;
using ll = long long;
 
ifstream fin("x.in");   // opens file x.in for reading
ofstream fout("x.out"); // opens or creates file x.out for writing
 
// minus is 1 plus is 0
 
void solve() {
  string n;
  cin >> n;
  bool check = false;

  ll size = n.size();
  ll sum = 0;
  ll twos = 0;
  ll threes = 0;

  for (ll i = 0; i < size; ++i) {
    char sub = n[i];
    sum += (ll)sub - 48;
    if ((ll)sub - 48 == 2) {
      ++twos;
    } else if ((ll)sub - 48 == 3) {
      ++threes;
    }
  }

  ll alteredsum = sum & 9;

  if (twos > 8) {
    twos = 8;
  }

  if (threes > 8) {
    threes = 8;
  }

  for (ll a = 0; a < threes + 1; ++a) {
    for (ll b = 0; b < twos + 1; ++b) {
      if ((sum + b*2 + a*6) % 9 == 0) {
        cout << "YES" << "\n";
        return;
      }
    }
  }

  cout << "NO" << "\n";
}

int main() {

  ll t;
  cin >> t;
  while(t--) {
  solve();
  }
 
  return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 4):
#include<bits/stdc++.h>

using namespace std;
using i64=long long;
using u64=unsigned long long;

void solve(){
    int n;
    cin>>n;
    vector<int> a(n+1);
    for(int i=1;i<=n;++i){
        cin>>a[i];
    }
    vector<array<int,2>> ans;
    for(int i=1;i<n;i++){
        if(a[i+1]>a[i]){
            vector<int> tem;
            for(int j=i;j<=n;++j){
                if(a[j]<a[i]){
                    ans.push_back({a[i],a[j]});
                    tem.push_back(a[j]);
                }
            } 
            for(auto p:tem)
                ans.push_back({a[i+1],p}); 
            tem.clear();
            ans.push_back({a[i+1],a[i]});
            ans.push_back({a[i],a[i+1]});
            i++;
            continue;
        }
        for(int j=i;j<=n;++j){
            if(a[j]<a[i]){
                ans.push_back({a[i],a[j]});
            }
        }
    }
    cout<<ans.size()<<'\n'; 
    for(auto [x,y]:ans){
        cout<<x<<' '<<y<<'\n';
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    solve();
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 4):
#include<bits/stdc++.h>

using namespace std;
using i64=long long;
using u64=unsigned long long;

void solve(){
    int n;
    cin>>n;
    vector<int> a(n+1);
    for(int i=1;i<=n;++i){
        cin>>a[i];
    }
    vector<array<int,2>> ans;
    for(int i=1;i<=n;++i){
        for(int j=1;j<n;++j){
            if(a[j+1]>a[j]){
                swap(a[i+1],a[i]);
                ans.push_back({a[i+1],a[i]});
            }
        }
    }
    for(int i=1;i<=n;++i){
        for(int j=1;j<n;++j){
            if(a[j+1]<a[j]){
                swap(a[j+1],a[j]);
                ans.push_back({a[j+1],a[j]});
            }
        }
    }
    reverse(ans.begin(),ans.end());
    cout<<ans.size()<<'\n'; 
    for(auto [x,y]:ans){
        cout<<x<<' '<<y<<'\n';
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    solve();
    return 0;
}

Submission (verdict: Accepted):
#include<bits/stdc++.h>

using namespace std;
using i64=long long;
using u64=unsigned long long;

void solve(){
    int n;
    cin>>n;
    vector<int> a(n+1);
    for(int i=1;i<=n;++i){
        cin>>a[i];
    }
    vector<array<int,2>> ans;
    for(int i=1;i<=n;++i){
        for(int j=1;j<n;++j){
            if(a[j+1]>a[j]){
                swap(a[j+1],a[j]);
                ans.push_back({a[j+1],a[j]});
            }
        }
    }
    for(int i=1;i<=n;++i){
        for(int j=1;j<n;++j){
            if(a[j+1]<a[j]){
                swap(a[j+1],a[j]);
                ans.push_back({a[j+1],a[j]});
            }
        }
    }
    reverse(ans.begin(),ans.end());
    cout<<ans.size()<<'\n'; 
    for(auto [x,y]:ans){
        cout<<x<<' '<<y<<'\n';
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    solve();
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 4):
#include<bits/stdc++.h>

using namespace std;
using i64=long long;
using u64=unsigned long long;

void solve(){
    int n;
    cin>>n;
    vector<int> a(n+1);
    for(int i=1;i<=n;++i){
        cin>>a[i];
    }
    vector<array<int,2>> ans;
    for(int i=1;i<n;i++){
        if(a[i+1]>a[i]){
            vector<int> tem;
            for(int j=i;j<=n;++j){
                if(a[j]<a[i]){
                    ans.push_back({a[i],a[j]});
                    tem.push_back(a[j]);
                }
            } 
            for(auto p:tem)
                ans.push_back({a[i+1],p}); 
            tem.clear();
            ans.push_back({a[i+1],a[i]});
            ans.push_back({a[i],a[i+1]});
            i++;
            continue;
        }
        for(int j=i;j<=n;++j){
            if(a[j]<a[i]){
                ans.push_back({a[i],a[j]});
            }
        }
    }
    cout<<ans.size()<<'\n'; 
    for(auto [x,y]:ans){
        cout<<x<<' '<<y<<'\n';
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    solve();
    return 0;
}

Submission (verdict: Wrong answer on test 4):
#include<bits/stdc++.h>

using namespace std;
using i64=long long;
using u64=unsigned long long;

void solve(){
    int n;
    cin>>n;
    vector<int> a(n+1);
    for(int i=1;i<=n;++i){
        cin>>a[i];
    }
    vector<array<int,2>> ans;
    for(int i=1;i<=n;++i){
        for(int j=1;j<n;++j){
            if(a[j+1]>a[j]){
                swap(a[i+1],a[i]);
                ans.push_back({a[i+1],a[i]});
            }
        }
    }
    for(int i=1;i<=n;++i){
        for(int j=1;j<n;++j){
            if(a[j+1]<a[j]){
                swap(a[j+1],a[j]);
                ans.push_back({a[j+1],a[j]});
            }
        }
    }
    reverse(ans.begin(),ans.end());
    cout<<ans.size()<<'\n'; 
    for(auto [x,y]:ans){
        cout<<x<<' '<<y<<'\n';
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    solve();
    return 0;
}
Problem: 2063C - Remove Exactly Two
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define setbits(x) __builtin_popcountll(x)
template <typename T1, typename T2> auto ceil(T1 a, T2 b) {
    return (static_cast<long long>(a) + static_cast<long long>(b) - 1) / b;
}

const int mod = 1e9 + 7;
const int inf = 2e9 + 5;
const long long infl = 2e18 + 5;
double PI = 3.14159265358979323846;

#ifdef LOCAL
#include "algo/debug.h"
#else
#define db(...) 20
#endif

void solve() {
    int n;
    cin >> n;
    vector<vector<int>> g(n);
    for (int i = 0; i < n - 1; i++) {
        int u, v;
        cin >> u >> v;
        u--;
        v--;
        g[u].push_back(v);
        g[v].push_back(u);
    }

    vector<int> order(n);
    iota(all(order), 0);
    sort(all(order), [&](int i, int j) { return g[i].size() > g[j].size(); });

    db(order);
    int toRemove = order[0];
    int firstRemove = toRemove;
    g[toRemove].clear();
    for (int i = 0; i < n; i++) {
        g[i].erase(remove(all(g[i]), toRemove), g[i].end());
    }

    order.erase(find(all(order), firstRemove));
    sort(all(order), [&](int i, int j) { return g[i].size() > g[j].size(); });

    toRemove = order[0];
    int secondRemove = toRemove;
    g[toRemove].clear();
    for (int i = 0; i < n; i++) {
        g[i].erase(remove(all(g[i]), toRemove), g[i].end());
    }

    order.erase(find(all(order), secondRemove));
    db(order);

    vector<int> visited(n, 0);
    function<void(int)> dfs = [&](int u) {
        visited[u] = true;
        for (int v : g[u]) {
            if (!visited[v]) {
                dfs(v);
            }
        }
    };

    db(firstRemove, secondRemove);

    int connectedComponents = 0;
    for (int i = 0; i < n; i++) {
        if (i == firstRemove || i == secondRemove)
            continue;
        if (!visited[i]) {
            dfs(i);
            connectedComponents++;
        }
    }
    cout << connectedComponents << endl;
}

int32_t main() {
    fastio;
    int testCases = 1;
    cin >> testCases;
    for (int i = 1; i <= testCases; i++) {
        solve();
    }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Time limit exceeded on test 1):
#include<bits/stdc++.h>
using namespace std;
#define int long long

void solve()
{
/*      */
    int n;
    cin>>n;
    vector<int>v;
    vector<int>temp;
    for(int i=0; i<n; i++)
    {
        int x;
        cin>>x;
        v.push_back(x);   
    }
    if(n == 1)
    {
        cout<<v[0]<<endl;
        return;
    }
    int maxi = abs(accumulate(v.begin(),v.end(),0));
    while(v.size()>1)
    {
        int sum = 0;
        for(int i=1; i<n; i++)
        {
            sum += v[i]-v[i-1];
            temp.push_back(sum);
        }
        maxi = max(maxi, abs(sum));
        v = temp;
        temp.clear();
    }
    cout<<maxi<<endl;
}
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int g;
    cin>>g;
    while(g--)
    {
        solve();  
    }
return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
#define int long long

void solve()
{
/*      */
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0; i<n; i++)
    {
        int x;
        cin>>x;
        v.push_back(x);   
    }
    int maxi = abs(accumulate(v.begin(),v.end(),0));
    while(v.size()>1)
    {
        int sum = 0;
        for(int i=1; i<v.size(); i++)
        {
            sum += v[i]-v[i-1];
            v[i-1] = v[i]-v[i-1];
        }
        maxi = max(maxi, abs(sum));
        v.pop_back();
    }
    cout<<max(maxi,v.front())<<endl;
}
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int g;
    cin>>g;
    while(g--)
    {
        solve();  
    }
return 0;
}

Submission (verdict: Accepted):
#include<bits/stdc++.h>
using namespace std;
#define int long long

void solve()
{
/*      */
    int n;
    cin>>n;
    vector<int>v;
    int initial = 0;
    for(int i=0; i<n; i++)
    {
        int x;
        cin>>x;
        v.push_back(x);   
        initial+=x;
    }
    int maxi = initial;
    while(v.size()>1)
    {
        int sum = 0;
        for(int i=1; i<v.size(); i++)
        {
            sum += v[i]-v[i-1];
            v[i-1] = v[i]-v[i-1];
        }
        maxi = max(maxi, abs(sum));
        v.pop_back();
    }
    cout<<maxi<<endl;
}
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int g;
    cin>>g;
    while(g--)
    {
        solve();  
    }
return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Time limit exceeded on test 1):
#include<bits/stdc++.h>
using namespace std;
#define int long long

void solve()
{
/*      */
    int n;
    cin>>n;
    vector<int>v;
    vector<int>temp;
    for(int i=0; i<n; i++)
    {
        int x;
        cin>>x;
        v.push_back(x);   
    }
    if(n == 1)
    {
        cout<<v[0]<<endl;
        return;
    }
    int maxi = abs(accumulate(v.begin(),v.end(),0));
    while(v.size()>1)
    {
        int sum = 0;
        for(int i=1; i<n; i++)
        {
            sum += v[i]-v[i-1];
            temp.push_back(sum);
        }
        maxi = max(maxi, abs(sum));
        v = temp;
        temp.clear();
    }
    cout<<maxi<<endl;
}
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int g;
    cin>>g;
    while(g--)
    {
        solve();  
    }
return 0;
}

Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;
#define int long long

void solve()
{
/*      */
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0; i<n; i++)
    {
        int x;
        cin>>x;
        v.push_back(x);   
    }
    int maxi = abs(accumulate(v.begin(),v.end(),0));
    while(v.size()>1)
    {
        int sum = 0;
        for(int i=1; i<v.size(); i++)
        {
            sum += v[i]-v[i-1];
            v[i-1] = v[i]-v[i-1];
        }
        maxi = max(maxi, abs(sum));
        v.pop_back();
    }
    cout<<max(maxi,v.front())<<endl;
}
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int g;
    cin>>g;
    while(g--)
    {
        solve();  
    }
return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)


Submission (verdict: Runtime error on test 3):
#include<bits/stdc++.h>
#define ll long long
using namespace std;

bool findEl(multiset <ll> &ms, ll val, vector <ll> k){
    if (val == 1){
        auto pt = ms.find(val);
        if (pt == ms.end()){
            return false;
        }
        else{
            k.push_back(val);
            ms.erase(pt);
            return true;
        }
    } 
    auto pt = ms.find(val);
    if (pt == ms.end()){
        //could not find val
        return findEl(ms,val/2,k)&&findEl(ms,val/2 + (val&1),k);
    }else{
        ms.erase(pt);
        return true;
    }

}


int main() {

    int t;
    cin>>t;
    while(t--){
        int n,m;
        cin>>n>>m;
        
        multiset <ll> m1,m2;

        for (int i = 0; i<n; i++){
            int x;cin>>x;
            m1.insert(x);
        }
        for (int i = 0; i<m; i++){
            int x;
            cin>>x;
            auto pt = m1.find(x);
            if (pt != m1.end()){
                m1.erase(pt);
            }else{
                m2.insert(x);
            }
        }

        for (auto it = m2.begin(); it!= m2.end(); it++){
            vector <ll> k;
            bool found = findEl(m1,*it,k);
            if (found){
                auto x = it;
                m2.erase(x);
            }else{
                for (int i : k){
                    m1.insert(i);
                }
            }
        }

        if (m2.size() == 0 && m1.size() == 0){
            cout<<"yes"<<endl;
        }else{
            cout<<"no"<<endl;
        }



    }

    return 0;
}