ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2063C - Remove Exactly Two
Language: C++20 (GCC 13-64)

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

int n, u, v, cnt;
map<int, int> x;
unordered_map<int, vector<int>> q;
bool out;

void dfs(int start, int t1, int t2, int parent, vector<bool>& vis)
{
	int c = 0;
	vis[start] = true;
	for(auto& i : q[start]){
		if(i != t1 && i != t2 && i != parent){
			dfs(i, t1, t2, start, vis);
			c++;
		}
	}
	
	if(c == 0){
		cnt++;
	}
}

bool comp(pair<int, int>& a, pair<int, int>& b){
	return a.second > b.second;
}

void solve()
{
	cin >> n;
	for(int i = 1; i <= n-1; i++){
		cin >> u >> v;
		x[u]++;
		x[v]++;
		q[u].push_back(v);
		q[v].push_back(u);
	}
	vector<pair<int, int>> mp(x.begin(), x.end());
	sort(mp.begin(), mp.end(), comp);
	
	if(mp[0].second == mp[1].second && mp[1].second == mp[2].second){
		cout << mp[0].second * 2 - 1 << "\n";
		return;
	}
	
	cnt = 0;
	out = false;
	vector<bool> vis(n);
	for(int i = 2; i <= n-1; i++){
		if(vis[mp[i].first]) continue;
		dfs(mp[i].first, mp[0].first, mp[1].first, 0, vis);
	}
	cout << cnt << "\n";
}
 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int t; cin >> t;
	while(t--){
		solve();
		x.clear();
		q.clear();
	}
	
	
}

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

int n, u, v, ans, a;
unordered_map<int, vector<int>> q;
map<int, int> x;
multiset<int> e;


void solve()
{
	cin >> n;
	for(int i = 1; i <= n-1; i++){
		cin >> u >> v;
		x[u]++;
		x[v]++;
		q[u].push_back(v);
		q[v].push_back(u);
		
	}
	
	for(int i = 1; i <= n; i++){
		e.insert(x[i]);
	}
	
	ans = 0;
	for(int i = 1; i <= n; i++){
		a = 0;
		a += x[i];
		e.erase(e.find(x[i]));
		
		for(int a : q[i]){
			e.erase(e.find(x[a]));
			e.insert(x[a] - 1);
		}
		
		a += *e.rbegin();
		
		for(int a : q[i]){
			e.erase(e.find(x[a] - 1));
			e.insert(x[a]);
		}
		
		e.insert(x[i]);
		a--;
		ans = max(ans, a);
	}
	
	cout << ans << "\n";
}
 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int t; cin >> t;
	while(t--){
		solve();
		q.clear();
		x.clear();
		e.clear();
	}
	
	
}
Problem: 2063C - Remove Exactly Two
Language: C++20 (GCC 13-64)


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

int n, u, v, cnt;
map<int, int> x;
unordered_map<int, vector<int>> q;
bool out;

void dfs(int start, int t1, int t2, int parent, vector<bool>& vis)
{
	int c = 0;
	vis[start] = true;
	for(auto& i : q[start]){
		if(i != t1 && i != t2 && i != parent){
			dfs(i, t1, t2, start, vis);
			c++;
		}
	}
	
	if(c == 0){
		cnt++;
	}
}

bool comp(pair<int, int>& a, pair<int, int>& b){
	return a.second > b.second;
}

void solve()
{
	cin >> n;
	for(int i = 1; i <= n-1; i++){
		cin >> u >> v;
		x[u]++;
		x[v]++;
		q[u].push_back(v);
		q[v].push_back(u);
	}
	vector<pair<int, int>> mp(x.begin(), x.end());
	sort(mp.begin(), mp.end(), comp);
	cnt = 0;
	out = false;
	vector<bool> vis(n);
	for(int i = 2; i <= n-1; i++){
		if(vis[mp[i].first]) continue;
		dfs(mp[i].first, mp[0].first, mp[1].first, 0, vis);
	}
	cout << cnt << "\n";
}
 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int t; cin >> t;
	while(t--){
		solve();
		x.clear();
		q.clear();
	}
	
	
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define PII pair<int, int>
#define cout_ cout << "*"
const int N = 2e5 + 5, M = 5005;
const int mod = 998244353;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;
// mt19937_64 rng {chrono::steady_clock::now().time_since_epoch().count()};

void solve()
{
    int l,r;
    cin>>l>>r;
    int high=1;
    while(high<=r){
        high*=2;
    }
    high/=2;
    cout<<high<<" "<<high-1<<" "<<high-2<<endl;
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
    cin >> T;
    while (T--)
    {
        solve();
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define PII pair<int, int>
#define cout_ cout << "*"
const int N = 2e5 + 5, M = 5005;
const int mod = 998244353;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;
// mt19937_64 rng {chrono::steady_clock::now().time_since_epoch().count()};

void solve()
{
    int l,r;
    cin>>l>>r;
    int high=0;
    while((1<<high)<=r) high++;
    high--;
    int a=0,b=0,c=0;
    for(int i=high;i>=0;i--){
        if(((r>>i)&1)&&((l>>i)&1)) a+=1<<i,b+=1<<i,c+=1<<i;
        else if(((r>>i)%2==0)&&((l>>i)%2==0)) continue;
        else {
            if((a+(1<<i)+1)<=r){
                cout<<a+(1<<i)+1<<" "<<b+(1<<i)<<" "<<c+(1<<i)-1<<endl;
                return ;
            }
            else {
                cout<<a+(1<<i)<<" "<<b+(1<<i)-1<<" "<<c+(1<<i)-2<<endl;
                return ;
            }
        }
    }
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
    cin >> T;
    while (T--)
    {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define PII pair<int, int>
#define cout_ cout << "*"
const int N = 2e5 + 5, M = 5005;
const int mod = 998244353;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;
// mt19937_64 rng {chrono::steady_clock::now().time_since_epoch().count()};

void solve()
{
    int l,r;
    cin>>l>>r;
    int high=1;
    while(high<=r){
        high*=2;
    }
    high/=2;
    cout<<high<<" "<<high-1<<" "<<high-1<<endl;
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
    cin >> T;
    while (T--)
    {
        solve();
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define PII pair<int, int>
#define cout_ cout << "*"
const int N = 2e5 + 5, M = 5005;
const int mod = 998244353;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;
// mt19937_64 rng {chrono::steady_clock::now().time_since_epoch().count()};

void solve()
{
    int l,r;
    cin>>l>>r;
    int high=1;
    while(high<=r){
        high*=2;
    }
    high/=2;
    cout<<high<<" "<<high-1<<" "<<high-2<<endl;
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
    cin >> T;
    while (T--)
    {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define PII pair<int, int>
#define cout_ cout << "*"
const int N = 2e5 + 5, M = 5005;
const int mod = 998244353;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;
// mt19937_64 rng {chrono::steady_clock::now().time_since_epoch().count()};

void solve()
{
    int l,r;
    cin>>l>>r;
    int high=1;
    while(high<=r){
        high*=2;
    }
    high/=2;
    cout<<high<<" "<<high-1<<" "<<high-1<<endl;
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
    cin >> T;
    while (T--)
    {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<iomanip>
#include<cstring>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<climits>
#include<array>
#include<queue>
#include<bitset>

#define int long long
#define cd(n,d) std::cout<<std::fixed<<std::setprecision((n))<<(d) 
#define ms(a,b) std::memset((a),(b),sizeof(a))
#define mc(a,b) std::memcpy((a),(b),sizeof(b))
#define all(v) (v).begin(),(v).end()
#define fill(v,x) std::fill((v).begin(),(v).end(),(x))
#define iota(v,x) std::iota((v).begin(),(v).end(),(x))
#define cln std::cout<<"\n"
#define eb emplace_back
#define pb pop_back
#define ef emplace_front
#define pf pop_front 
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FOR0(i,x,y) for(int i=(x);i<(y);i++)
#define _FOR(i,x,y) for(int i=(x);i>=(y);i--)
#define _FOR0(i,x,y) for(int i=(x);i>(y);i--)
#define F first
#define S second

void solve(){
	int l,r;
	std::cin>>l>>r;
	int a=l,c=r,b=0;
	int o=std::log2(r);
	bool flag=true;
	int t=0;
	_FOR(i,o,0){
		int x=l>>i&1,y=r>>i&1;
		if(x==y){
			if(flag){
				b|=x<<i;
			}else{
				b|=(x^1)<<i;
			}
		}else{
			if(flag){
				_FOR(j,i,0){
					if((l>>j&1)==(r>>j&1)){
						t=l>>j&1;
						break;
					}
					b|=t<<i;
					flag=false;
				}
			}else{
				b|=(t^1)<<i;
			}
		}
	}
	std::cout<<a<<" "<<b<<" "<<c<<"\n";
}

signed main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int T=1;
	std::cin>>T;
	while(T--){
		solve();
	}
	return 0;
}

Submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<iomanip>
#include<cstring>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<climits>
#include<array>
#include<queue>
#include<bitset>

#define int long long
#define cd(n,d) std::cout<<std::fixed<<std::setprecision((n))<<(d) 
#define ms(a,b) std::memset((a),(b),sizeof(a))
#define mc(a,b) std::memcpy((a),(b),sizeof(b))
#define all(v) (v).begin(),(v).end()
#define fill(v,x) std::fill((v).begin(),(v).end(),(x))
#define iota(v,x) std::iota((v).begin(),(v).end(),(x))
#define cln std::cout<<"\n"
#define eb emplace_back
#define pb pop_back
#define ef emplace_front
#define pf pop_front 
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FOR0(i,x,y) for(int i=(x);i<(y);i++)
#define _FOR(i,x,y) for(int i=(x);i>=(y);i--)
#define _FOR0(i,x,y) for(int i=(x);i>(y);i--)
#define F first
#define S second

void solve(){
	int l,r;
	std::cin>>l>>r;
	int a=l,c=r,b=0;
	int o=std::log2(r);
	bool flag=true;
	int t=0;
	_FOR(i,o,0){
		int x=l>>i&1,y=r>>i&1;
		if(x==y){
			if(flag){
				b|=x<<i;
			}else{
				b|=(x^1)<<i;
			}
		}else{
			if(flag){
				_FOR(j,i,0){
					if((l>>j&1)==(r>>j&1)){
						t=l>>j&1;
						break;
					}
				}
				b|=t<<i;
				flag=false;
			}else{
				b|=(t^1)<<i;
			}
		}
	}
	std::cout<<a<<" "<<b<<" "<<c<<"\n";
}

signed main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int T=1;
	std::cin>>T;
	while(T--){
		solve();
	}
	return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<iomanip>
#include<cstring>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<climits>
#include<array>
#include<queue>
#include<bitset>

#define int long long
#define cd(n,d) std::cout<<std::fixed<<std::setprecision((n))<<(d) 
#define ms(a,b) std::memset((a),(b),sizeof(a))
#define mc(a,b) std::memcpy((a),(b),sizeof(b))
#define all(v) (v).begin(),(v).end()
#define fill(v,x) std::fill((v).begin(),(v).end(),(x))
#define iota(v,x) std::iota((v).begin(),(v).end(),(x))
#define cln std::cout<<"\n"
#define eb emplace_back
#define pb pop_back
#define ef emplace_front
#define pf pop_front 
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FOR0(i,x,y) for(int i=(x);i<(y);i++)
#define _FOR(i,x,y) for(int i=(x);i>=(y);i--)
#define _FOR0(i,x,y) for(int i=(x);i>(y);i--)
#define F first
#define S second

void solve(){
	int l,r;
	std::cin>>l>>r;
	int a=l,c=r,b=0;
	int o=std::log2(r);
	bool flag=true;
	int t=0;
	_FOR(i,o,0){
		int x=l>>i&1,y=r>>i&1;
		if(x==y){
			if(flag){
				b|=x<<i;
			}else{
				b|=(x^1)<<i;
			}
		}else{
			if(flag){
				_FOR(j,i,0){
					if((l>>j&1)==(r>>j&1)){
						t=l>>j&1;
						break;
					}
					b|=t<<i;
					flag=false;
				}
			}else{
				b|=(t^1)<<i;
			}
		}
	}
	std::cout<<a<<" "<<b<<" "<<c<<"\n";
}

signed main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int T=1;
	std::cin>>T;
	while(T--){
		solve();
	}
	return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<iomanip>
#include<cstring>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<climits>
#include<array>
#include<queue>
#include<bitset>

#define int long long
#define cd(n,d) std::cout<<std::fixed<<std::setprecision((n))<<(d) 
#define ms(a,b) std::memset((a),(b),sizeof(a))
#define mc(a,b) std::memcpy((a),(b),sizeof(b))
#define all(v) (v).begin(),(v).end()
#define fill(v,x) std::fill((v).begin(),(v).end(),(x))
#define iota(v,x) std::iota((v).begin(),(v).end(),(x))
#define cln std::cout<<"\n"
#define eb emplace_back
#define pb pop_back
#define ef emplace_front
#define pf pop_front 
#define FOR(i,x,y) for(int i=(x);i<=(y);i++)
#define FOR0(i,x,y) for(int i=(x);i<(y);i++)
#define _FOR(i,x,y) for(int i=(x);i>=(y);i--)
#define _FOR0(i,x,y) for(int i=(x);i>(y);i--)
#define F first
#define S second

void solve(){
	int l,r;
	std::cin>>l>>r;
	int a=l,c=r,b=0;
	int o=std::log2(r);
	bool flag=true;
	int t=0;
	_FOR(i,o,0){
		int x=l>>i&1,y=r>>i&1;
		if(x==y){
			if(flag){
				b|=x<<i;
			}else{
				b|=(x^1)<<i;
			}
		}else{
			if(flag){
				_FOR(j,i,0){
					if((l>>j&1)==(r>>j&1)){
						t=l>>j&1;
						break;
					}
				}
				b|=t<<i;
				flag=false;
			}else{
				b|=(t^1)<<i;
			}
		}
	}
	std::cout<<a<<" "<<b<<" "<<c<<"\n";
}

signed main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int T=1;
	std::cin>>T;
	while(T--){
		solve();
	}
	return 0;
}

Submission (verdict: Accepted):
#include<iostream>
#include<cmath>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<map>
#include<cstring>
using namespace std;
#define ll long long
int main()
{
    ll t;
    cin>>t;
    for(ll k1=1;k1<=t;k1++)
    {
        ll i,j,k,cnt1=0,cnt2=0,l,r;
        cin>>l>>r;
        ll base=r;
        while(base>0) base/=2,cnt1++;
        ll a=0,b=0,c=0;
        a=pow(2,cnt1-1);
        while(cnt1>0)
        {
            if(b<l) b+=pow(2,cnt1-1);
            cnt1--;
            if(a+pow(2,cnt1-1)<=r) a+=pow(2,cnt1-1);
        }
        if(a-1==b) cout<<a<<" "<<b<<" "<<b-1<<endl;
        else cout<<a<<" "<<b<<" "<<a-1<<endl;
    }
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

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

void solve(){
	string s;
	cin >> s;
	ll n = s.size();
	s = '?' + s;
	ll n2 = 0;
	ll n3 = 0;
	ll sum = 0;
	for(ll i = 1 ; i <= n ; ++i){
		if(s[i] == '2') n2++;
		if(s[i] == '3') n3++;
		sum += s[i] - '0';
	}
	if(sum % 9 == 0){
		cout << "YES" << endl;
		return;
	}
	for(ll i = 0 ; i <= n2 ; ++i){
		for(ll j = 0 ; j <= n3 ; ++j){
			sum += n2 * 2 + n3 * 6;
			if(sum % 9 == 0){
				cout << "YES" << endl;
				return;
			}
		}
	}
	cout << "NO" << endl;
}

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

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

void solve(){
	string s;
	cin >> s;
	ll n = s.size();
	s = '?' + s;
	ll n2 = 0;
	ll n3 = 0;
	ll sum = 0;
	for(ll i = 1 ; i <= n ; ++i){
		if(s[i] == '2') n2++;
		if(s[i] == '3') n3++;
		sum += s[i] - '0';
	}
	if(sum % 9 == 0){
		cout << "YES" << endl;
		return;
	}
	for(ll i = 0 ; i <= n2 ; ++i){
		for(ll j = 0 ; j <= n3 ; ++j){
			sum += i * 2 + j * 6;
			if(sum % 9 == 0){
				cout << "YES" << endl;
				return;
			}
		}
	}
	cout << "NO" << endl;
}

signed main(){
	ll t;
	cin >> t;
	while(t--){
		solve();
	}
	return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)


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

void solve(){
	string s;
	cin >> s;
	ll n = s.size();
	s = '?' + s;
	ll n2 = 0;
	ll n3 = 0;
	ll sum = 0;
	for(ll i = 1 ; i <= n ; ++i){
		if(s[i] == '2') n2++;
		if(s[i] == '3') n3++;
		sum += s[i] - '0';
	}
	if(sum % 9 == 0){
		cout << "YES" << endl;
		return;
	}
	for(ll i = 0 ; i <= n2 ; ++i){
		for(ll j = 0 ; j <= n3 ; ++j){
			sum += n2 * 2 + n3 * 6;
			if(sum % 9 == 0){
				cout << "YES" << endl;
				return;
			}
		}
	}
	cout << "NO" << endl;
}

signed main(){
	ll t;
	cin >> t;
	while(t--){
		solve();
	}
	return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

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

void solve(){
	string s;
	cin >> s;
	ll n = s.size();
	s = '?' + s;
	ll n2 = 0;
	ll n3 = 0;
	ll sum = 0;
	for(ll i = 1 ; i <= n ; ++i){
		if(s[i] == '2') n2++;
		if(s[i] == '3') n3++;
		sum += s[i] - '0';
	}
	if(sum % 9 == 0){
		cout << "YES" << endl;
		return;
	}
	for(ll i = 0 ; i <= n2 ; ++i){
		for(ll j = 0 ; j <= n3 ; ++j){
			sum += i * 2 + j * 6;
			if(sum % 9 == 0){
				cout << "YES" << endl;
				return;
			}
		}
	}
	cout << "NO" << endl;
}

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

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

void solve(){
	string s;
	cin >> s;
	ll n = s.size();
	s = '?' + s;
	ll n2 = 0;
	ll n3 = 0;
	ll sum = 0;
	for(ll i = 1 ; i <= n ; ++i){
		if(s[i] == '2') n2++;
		if(s[i] == '3') n3++;
		sum += s[i] - '0';
	}
	if(sum % 9 == 0){
		cout << "YES" << endl;
		return;
	}
	for(ll i = 0 ; i <= n2 ; ++i){
		for(ll j = 0 ; j <= n3 ; ++j){
			ll tsum = sum + i * 2 + j * 6;
			if(tsum % 9 == 0){
				cout << "YES" << endl;
				return;
			}
		}
	}
	cout << "NO" << endl;
}

signed main(){
	ll t;
	cin >> t;
	while(t--){
		solve();
	}
	return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#include <vector>
#include <iostream>
#include <numeric>

using namespace std;

void print_vector(vector<int> vec) {
  for (auto i : vec) {
    cout << i << " ";
  }
  cout << endl;
}

int solution() {
  int count;
  cin >> count;
  vector<int> arr = vector<int>(count);
  for (auto it = arr.begin(); it < arr.end(); ++it) {
    cin >> *it;
  }

  int curr_sum = (accumulate(arr.begin(), arr.end(), 0));
  int max_sum = curr_sum;

  while (arr.size() > 1) {
    adjacent_difference(arr.begin(), arr.end(), arr.begin());
    arr.erase(arr.begin());
    curr_sum = abs(accumulate(arr.begin(), arr.end(), 0));
    if (curr_sum > max_sum) max_sum = curr_sum;
  }
  return max_sum;
}

int main() {
  int count;
  cin >> count;
  for (int i = 0; i < count; i++) {
    cout << solution() << endl;
  }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <vector>
#include <iostream>
#include <numeric>

using namespace std;

void print_vector(vector<int> vec) {
  for (auto i : vec) {
    cout << i << " ";
  }
  cout << endl;
}

int solution() {
  int count;
  cin >> count;
  vector<int> arr = vector<int>(count);
  for (auto it = arr.begin(); it < arr.end(); ++it) {
    cin >> *it;
  }

  int curr_sum = (accumulate(arr.begin(), arr.end(), 0));
  int max_sum = curr_sum;

  while (arr.size() > 1) {
    adjacent_difference(arr.begin(), arr.end(), arr.begin());
    arr.erase(arr.begin());
    curr_sum = abs(accumulate(arr.begin(), arr.end(), 0));
    if (curr_sum > max_sum) max_sum = curr_sum;
  }
  return max_sum;
}

int main() {
  int count;
  cin >> count;
  for (int i = 0; i < count; i++) {
    cout << solution() << endl;
  }
}


Submission (verdict: Wrong answer on test 2):
#include <vector>
#include <iostream>
#include <numeric>

using namespace std;

void print_vector(vector<int> vec) {
  for (auto i : vec) {
    cout << i << " ";
  }
  cout << endl;
}

long long solution() {
  int count;
  cin >> count;
  vector<int> arr = vector<int>(count);
  for (auto it = arr.begin(); it < arr.end(); ++it) {
    cin >> *it;
  }

  long long curr_sum = (accumulate(arr.begin(), arr.end(), 0));
  long long max_sum = curr_sum;

  while (arr.size() > 1) {
    adjacent_difference(arr.begin(), arr.end(), arr.begin());
    arr.erase(arr.begin());
    curr_sum = abs(accumulate(arr.begin(), arr.end(), 0));
    if (curr_sum > max_sum) max_sum = curr_sum;
  }
  return max_sum;
}

int main() {
  int count;
  cin >> count;
  for (int i = 0; i < count; i++) {
    cout << solution() << endl;
  }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <vector>
#include <iostream>
#include <numeric>

using namespace std;

void print_vector(vector<int> vec) {
  for (auto i : vec) {
    cout << i << " ";
  }
  cout << endl;
}

long long solution() {
  int count;
  cin >> count;
  vector<int> arr = vector<int>(count);
  for (auto it = arr.begin(); it < arr.end(); ++it) {
    cin >> *it;
  }

  long long curr_sum = (accumulate(arr.begin(), arr.end(), 0));
  long long max_sum = curr_sum;

  while (arr.size() > 1) {
    adjacent_difference(arr.begin(), arr.end(), arr.begin());
    arr.erase(arr.begin());
    curr_sum = abs(accumulate(arr.begin(), arr.end(), 0));
    if (curr_sum > max_sum) max_sum = curr_sum;
  }
  return max_sum;
}

int main() {
  int count;
  cin >> count;
  for (int i = 0; i < count; i++) {
    cout << solution() << endl;
  }
}


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

using namespace std;

void print_vector(vector<int> vec) {
  for (auto i : vec) {
    cout << i << " ";
  }
  cout << endl;
}

long long solution() {
  int count;
  cin >> count;
  vector<long long> arr = vector<long long>(count);
  for (auto it = arr.begin(); it < arr.end(); ++it) {
    cin >> *it;
  }


  long long curr_sum = (accumulate(arr.begin(), arr.end(), (long long)0));
  long long max_sum = curr_sum;

  while (arr.size() > 1) {
    adjacent_difference(arr.begin(), arr.end(), arr.begin());
    arr.erase(arr.begin());
    curr_sum = abs(accumulate(arr.begin(), arr.end(), (long long)0));
    if (curr_sum > max_sum) max_sum = curr_sum;
  }
  return max_sum;
}

int main() {
  int count;
  cin >> count;
  for (int i = 0; i < count; i++) {
    cout << solution() << endl;
  }
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

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

using namespace std;

#define int long long

#define endl '\n'

#define mod 1000000007



void solve() {

    int n;

    cin>>n;



    int sum=0;

    int cnt3=0,cnt2=0;



    while(n>0){

        int d=n%10;

        sum+=d;

        if(d==2)cnt2++;

        if(d==3)cnt3++;

        n=n/10;

    }



    for(int i=0;i<=cnt2;i++){

        for(int j=0;j<=cnt3;j++){

            if((sum + i*2 + j*6)%9==0){

                cout<<"YES"<<endl;

                return;

            }

        }

    }



    cout<<"NO"<<endl;

}





int32_t main() {

    ios::sync_with_stdio(false);

    cin.tie(nullptr);



    // int num=1;

    // while(num<100){

    //     s.insert(num*num);

    //     num+=2;

    // }



    int t;

    cin >> t;

    while (t--) 

        solve();



    return 0;

}



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

using namespace std;

#define int long long

#define endl '\n'

#define mod 1000000007



void solve() {

    string s;

    cin >> s;

        int cnt2=0,cnt3=0,sum=0;

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

            sum += s[i] - '0';

            if (s[i] == '2')++cnt2;

            else if (s[i] == '3')++cnt3;

        }



    for(int i=0;i<=cnt2;i++){

        for(int j=0;j<=cnt3;j++){

            if((sum + i*2 + j*6)%9==0){

                cout<<"YES"<<endl;

                return;

            }

        }

    }



    cout<<"NO"<<endl;

}





int32_t main() {

    ios::sync_with_stdio(false);

    cin.tie(nullptr);



    // int num=1;

    // while(num<100){

    //     s.insert(num*num);

    //     num+=2;

    // }



    int t;

    cin >> t;

    while (t--) 

        solve();



    return 0;

}