ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
 
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ln '\n'
#define sep ' '
#define ve vector

using namespace std;
 
using pii = pair<int, int>;
using ll  = long long;
using ull = unsigned ll;

constexpr int N = 2e5;
int n, m, a[N], b[N];

void solve()
{
  cin >> n >> m;
  map<int, int> freqa, freqb;
  for (int i = 0; i < n; ++i) 
  {
    cin >> a[i];
    ++freqa[a[i]];
  }
  for (int i = 0; i < m; ++i) 
  {
    cin >> b[i];
    ++freqb[b[i]];
  }
  bool ok = true;
  multiset<ll> mst;
  for (const auto &[k, v] : freqa)
  {
    if (v != freqb[k])
    {
      for (int i = 0; i < v; ++i) mst.insert(k);
    }
  }
  while (mst.size() >= 2)
  {
    ll x = *mst.begin(), y = *next(mst.begin());
    if (freqa[x] == freqb[x])
    {
      mst.erase(mst.begin());
      continue;
    }
    if (freqa[y] == freqb[y])
    {
      mst.erase(next(mst.begin()));
      continue;
    }
    if (y - x > 1) { ok = false; break; }
    mst.erase(mst.begin()); mst.erase(mst.begin());
    --freqa[x]; --freqa[y];
    ++freqa[x + y]; mst.insert(x + y);
  }
  for (auto it = freqa.begin(); it != freqa.end(); )
  {
    if (it->second == 0) it = freqa.erase(it);
    else ++it;
  }
  for (auto it = freqb.begin(); it != freqb.end(); )
  {
    if (it->second == 0) it = freqb.erase(it);
    else ++it;
  }
  ok &= freqa == freqb;
  if (ok) cout << "Yes\n";
  else cout << "No\n";
}

int main()
{
  fastio;
  int t = 1; 
  cin >> t;
  while (t--)
  {
    solve();
  }
  return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
 
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ln '\n'
#define sep ' '
#define ve vector

using namespace std;
 
using pii = pair<int, int>;
using ll  = long long;
using ull = unsigned ll;

constexpr int N = 2e5;
int n, m, a[N], b[N];

void solve()
{
  cin >> n >> m;
  map<ll, int> freqa, freqb;
  for (int i = 0; i < n; ++i) 
  {
    cin >> a[i];
    ++freqa[a[i]];
  }
  for (int i = 0; i < m; ++i) 
  {
    cin >> b[i];
    ++freqb[b[i]];
  }
  bool ok = true;
  multiset<ll> mst;
  for (const auto &[k, v] : freqa)
  {
    if (v != freqb[k])
    {
      for (int i = 0; i < v; ++i) mst.insert(k);
    }
  }
  while (mst.size() >= 2)
  {
    ll x = *mst.begin(), y = *next(mst.begin());
    if (freqa[x] == freqb[x])
    {
      mst.erase(mst.begin());
      continue;
    }
    if (freqa[y] == freqb[y])
    {
      mst.erase(next(mst.begin()));
      continue;
    }
    if (x == y && freqa[x] - 2 < freqb[x])
    {
      mst.erase(mst.begin());
      continue;
    }
    if (y - x > 1) 
    { 
      mst.erase(mst.begin());
      continue;
    }
    mst.erase(mst.begin()); mst.erase(mst.begin());
    --freqa[x]; --freqa[y];
    ++freqa[x + y]; mst.insert(x + y);
  }
  for (auto it = freqa.begin(); it != freqa.end(); )
  {
    if (it->second == 0) it = freqa.erase(it);
    else ++it;
  }
  for (auto it = freqb.begin(); it != freqb.end(); )
  {
    if (it->second == 0) it = freqb.erase(it);
    else ++it;
  }
  ok &= freqa == freqb;
  if (ok) cout << "Yes\n";
  else cout << "No\n";
}

int main()
{
  fastio;
  int t = 1; 
  cin >> t;
  while (t--)
  {
    solve();
  }
  return 0;
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
 
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ln '\n'
#define sep ' '
#define ve vector

using namespace std;
 
using pii = pair<int, int>;
using ll  = long long;
using ull = unsigned ll;

int n, m;
multiset<int> A, B;

bool f(int x)
{
  if (A.find(x) != A.end())
  {
    A.erase(A.find(x));
    return 1;
  }
  if (x == 0) return false;
  return f(x / 2) && f((x + 1) / 2);
}

void solve()
{
  A.clear(); B.clear();
  cin >> n >> m;
  for (int i = 0; i < n; ++i) { int x; cin >> x; A.insert(x); }
  for (int i = 0; i < m; ++i) { int x; cin >> x; B.insert(x); }
  for (auto x : B) 
  {
    bool ret = f(x);
    if (!ret)
    {
      cout << "No\n";
      return;
    }
  }
  if (A.empty()) cout << "Yes\n";
  else cout << "No\n";
}

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


Submission (verdict: Wrong answer on test 1):
// #define NDEBUG

#define ce constexpr
#define tt template <typename T>
#define tt_ template <typename... T>
#define tn template <size_t N>
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define eb emplace_back
#define whole(x) (x).begin(), (x).end()
#define rwhole(x) (x).rbegin(), (x).rend()

#include <bits/stdc++.h>
// #include <bits/extc++.h>

using ll = long long;
using lll = __int128_t;
using ld = long double;
using uchar = unsigned char;
using ushort = unsigned short;
using uint = unsigned int;
using ull = unsigned long long;
using ulll = __uint128_t;
ce int mod9 = 998244353;
ce int mod10 = 1000000007;
ce int inf = 0x3f3f3f3f;
ce int neginf = 0xc0c0c0c0;
ce ll infll = 0x3f3f3f3f3f3f3f3f;
ce ll neginfll = 0xc0c0c0c0c0c0c0c0;
tt ce T &maxeq(T &a, const T &b) { return a < b ? (a = b) : a; }
tt ce T &mineq(T &a, const T &b) { return a > b ? (a = b) : a; }
ce int mylog(uint x) { return 31 - __builtin_clz(x); }
ce int mylogc(uint x) { return 32 - __builtin_clz(x - 1); }
ce int mylogll(ull x) { return 63 - __builtin_clzll(x); }
ce int mylogcll(ull x) { return 64 - __builtin_clzll(x - 1ULL); }

using namespace std;
tt_ using vec = vector<T...>;
tt_ using mset = multiset<T...>;
tt_ using mmap = multimap<T...>;
tt_ using uset = unordered_set<T...>;
tt_ using umap = unordered_map<T...>;
tt_ using umset = unordered_multiset<T...>;
tt_ using ummap = unordered_multimap<T...>;
tt_ using pq = priority_queue<T...>;
using pbb = pair<bool, bool>;
using pbi = pair<bool, int>;
using pbd = pair<bool, double>;
using pib = pair<int, bool>;
using pii = pair<int, int>;
using pid = pair<int, double>;
using pdb = pair<double, bool>;
using pdi = pair<double, int>;
using pdd = pair<double, double>;
using vb = vec<bool>;
using vi = vec<int>;
using vll = vec<ll>;
using vd = vec<double>;

// template <typename S, typename T>
// using rbtree = __gnu_pbds::tree<S, __gnu_pbds::null_type, T, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;

#undef tt
#undef tt_
#undef tn

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> p(n);
    for (int i{}; i < n; ++i)
    {
        int x;
        cin >> x;
        p[--x] = i;
    }
    int cnt{};
    vector<int> a(n), np(n);
    iota(whole(a), 0);
    iota(whole(np), 0);
    vector<pair<int, int>> ans;
    for (int i{}; i < n; ++i)
    {
        for (int j{np[i] + 1}; j < n && (a[j] > i || p[a[j]] < p[i]); ++j)
        {
            ++cnt;
            ans.eb(i, a[j]);
            np[a[j]] = j - 1;
            np[i] = j;
            swap(a[j - 1], a[j]);
        }
        for (int j{np[i] - 1}; j >= 0 && p[i] < p[a[j]]; --j)
        {
            ++cnt;
            ans.eb(a[j], i);
            np[a[j]] = j + 1;
            np[i] = j;
            swap(a[j], a[j + 1]);
        }
    }
    cout << cnt << '\n';
    for (auto [x, y] : ans)
        cout << x + 1 << ' ' << y + 1 << '\n';
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;

void solve(){
	cin >> n;
	vector<int> c(n + 1, 0);
	vector<pair<int, int>> ans;
	int tot = 0 ;
	for (int i = 1;i <= n;i ++){
		cin >> c[i];
	}
	
	for (int i = 1;i <= n;i ++){
		for (int j = 1;j < i;j ++){
			if(c[j] < c[i]) {
				ans.push_back({c[i], c[j]});
				ans.push_back({c[j], c[i]});
				tot += 2;
			}
			else {
				ans.push_back({c[j], c[i]});
				tot += 1;
			}
		}
	}
	
	cout << ans.size()<<endl;
	for (auto c : ans){
		cout << c.first<<" "<< 	c.second<<endl;
	}
	
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}

Submission (verdict: Wrong answer on test 4):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;

void solve(){
	cin >> n;
	vector<int> c(n + 1, 0);
	vector<pair<int, int>> ans;
	int tot = 0 ;
	for (int i = 1;i <= n;i ++){
		cin >> c[i];
	}
	
	for (int i = n;i >= 1;i --){
		for (int j = 1;j < i;j ++){
			if(c[j] < c[i]) {
				ans.push_back({c[i], c[j]});
				ans.push_back({c[j], c[i]});
				tot += 2;
			}
			else {
				ans.push_back({c[j], c[i]});
				tot += 1;
			}
		}
	}
	
	cout << ans.size()<<endl;
	for (auto c : ans){
		cout << c.first<<" "<< c.second<<endl;
	}
	
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;
bool cmp(pair<int, int> a, pair<int, int> b){
	if(a.first != b.first) return a.first > b.first;
	return a.second > b.second;
}
void solve(){
	cin >> n;
	vector<int> c(n + 1, 0);
	vector<pair<int, int>> ans;
	int tot = 0 ;
	for (int i = 1;i <= n;i ++){
		cin >> c[i];
	}
	
	for (int i = 1;i <= n;i ++){
		
		for (int j = i + 1;j <= n;j ++){
			if(c[j] > c[i]){
				ans.push_back({c[j], c[i]});
				tot ++;
			}			
		}
		for (int j = i + 1;j <= n;j ++){
			ans.push_back({c[i], c[j]});
			tot ++;
		}
	}
	cout << ans.size()<<endl;
	sort(ans.begin(), ans.end(), cmp);
	for (auto c : ans){
		cout << c.first<<" "<< c.second<<endl;
	}
	
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}

Submission (verdict: Accepted):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;
// bool cmp(pair<int, int> a, pair<int, int> b){
	// if(a.first != b.first) return a.first > b.first;
	// return a.second > b.second;
// }
void solve(){
	cin >> n;
	vector<int> c(n + 1, 0);
	vector<pair<int, int>> ans;
	int tot = 0;
	map<int, int> idx;
	for (int i = 1;i <= n;i ++){
		cin >> c[i];
		idx[c[i]] = c[i];
	}
	vector<int> b(n + 1, 0);
	for (int i = 1;i <= n;i ++) b[i] = i;
	// 1 2 3
	for (int i = n;i >= 1;i --){
		int t = idx[c[i]];
		int x = idx[c[i]];
		for (int j = x - 1;j >= 1;j --){
			ans.push_back({b[t], b[j]});
			swap(b[t], b[j]);
			swap(idx[b[t]], idx[b[j]]);
			tot ++;
			t = j;
		}
		// for (int i = 1;i <= n;i ++) {
			// cout << b[i]<<" ";
		// }
		// cout << endl;
	}

	cout << ans.size()<<endl;
	for (auto c : ans){
		cout << c.first<<" "<< c.second<<endl;
	}
	
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;

void solve(){
	cin >> n;
	vector<int> c(n + 1, 0);
	vector<pair<int, int>> ans;
	int tot = 0 ;
	for (int i = 1;i <= n;i ++){
		cin >> c[i];
	}
	
	for (int i = n;i >= 1;i --){
		for (int j = 1;j < i;j ++){
			if(c[j] < c[i]) {
				ans.push_back({c[i], c[j]});
				ans.push_back({c[j], c[i]});
				tot += 2;
			}
			else {
				ans.push_back({c[j], c[i]});
				tot += 1;
			}
		}
	}
	
	cout << ans.size()<<endl;
	for (auto c : ans){
		cout << c.first<<" "<< c.second<<endl;
	}
	
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}

Submission (verdict: Wrong answer on test 4):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;

void solve(){
	cin >> n;
	vector<int> c(n + 1, 0);
	vector<pair<int, int>> ans;
	int tot = 0 ;
	for (int i = 1;i <= n;i ++){
		cin >> c[i];
	}
	
	for (int i = 1;i <= n;i ++){
		
		for (int j = i + 1;j <= n;j ++){
			if(c[j] > c[i]){
				ans.push_back({c[j], c[i]});
				tot ++;
			}			
		}
		for (int j = i + 1;j <= n;j ++){
			ans.push_back({c[i], c[j]});
			tot ++;
		}
	}
	cout << ans.size()<<endl;
	for (auto c : ans){
		cout << c.first<<" "<< c.second<<endl;
	}
	
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;

void solve(){
	cin >> n;
	vector<int> c(n + 1, 0);
	vector<pair<int, int>> ans;
	int tot = 0 ;
	for (int i = 1;i <= n;i ++){
		cin >> c[i];
	}
	
	for (int i = 1;i <= n;i ++){
		
		for (int j = i + 1;j <= n;j ++){
			if(c[j] > c[i]){
				ans.push_back({c[j], c[i]});
				tot ++;
			}			
		}
		for (int j = i + 1;j <= n;j ++){
			ans.push_back({c[i], c[j]});
			tot ++;
		}
	}
	cout << ans.size()<<endl;
	for (auto c : ans){
		cout << c.first<<" "<< c.second<<endl;
	}
	
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}

Submission (verdict: Wrong answer on test 1):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;
bool cmp(pair<int, int> a, pair<int, int> b){
	if(a.first != b.first) return a.first > b.first;
	return a.second > b.second;
}
void solve(){
	cin >> n;
	vector<int> c(n + 1, 0);
	vector<pair<int, int>> ans;
	int tot = 0 ;
	for (int i = 1;i <= n;i ++){
		cin >> c[i];
	}
	
	for (int i = 1;i <= n;i ++){
		
		for (int j = i + 1;j <= n;j ++){
			if(c[j] > c[i]){
				ans.push_back({c[j], c[i]});
				tot ++;
			}			
		}
		for (int j = i + 1;j <= n;j ++){
			ans.push_back({c[i], c[j]});
			tot ++;
		}
	}
	cout << ans.size()<<endl;
	sort(ans.begin(), ans.end(), cmp);
	for (auto c : ans){
		cout << c.first<<" "<< c.second<<endl;
	}
	
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 4):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;

void solve(){
	cin >> n;
	vector<int> c(n + 1, 0);
	vector<pair<int, int>> ans;
	int tot = 0 ;
	for (int i = 1;i <= n;i ++){
		cin >> c[i];
	}
	
	for (int i = 1;i <= n;i ++){
		for (int j = 1;j < i;j ++){
			if(c[j] < c[i]) {
				ans.push_back({c[i], c[j]});
				ans.push_back({c[j], c[i]});
				tot += 2;
			}
			else {
				ans.push_back({c[j], c[i]});
				tot += 1;
			}
		}
	}
	
	cout << ans.size()<<endl;
	for (auto c : ans){
		cout << c.first<<" "<< 	c.second<<endl;
	}
	
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int T = 1;
	// cin >> T;
	while (T --)
		solve();
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

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

using namespace std;
const int MAX = 1e18;

signed main() {
    int t;
    cin >> t;
    while (t) {
            t--;
        int n;
        cin >> n;
        vector<int> a(n);
        bool fl = true;
        int sum = 0;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            sum += a[i];
            if (a[i] <= 0) fl = false;
        }
        if (n == 1) {
            cout << a[0] << endl;
            continue;
        }
        if (fl) {
            cout << sum << endl;
            continue;
        }
        for (int j = n-1; j > 0; j--) {
            for (int i = 0; i < j; i++)
                a[i] = a[i+1] - a[i];
        }
        cout << abs(a[0]) << endl;
    }
}


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

using namespace std;
const int INF = 1e18;

signed main() {
    int t;
    cin >> t;
    while (t) {
        t--;
        int n;
        cin >> n;
        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        vector<int> sums(n);
        for (int i = 0; i < n; i++)
            sums[0] += a[i];
        for (int j = n-1; j > 0; j--) {
            for (int i = 0; i < j; i++) {
                a[i] = a[i+1] - a[i];
                sums[j] += a[i];
            }
            sums[j] = abs(sums[j]);
        }
        int ans = -INF;
        for (int i = 0; i < n; i++)
            ans = max(ans, sums[i]);
        cout << ans << endl;
    }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


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

using namespace std;
const int MAX = 1e18;

signed main() {
    int t;
    cin >> t;
    while (t) {
            t--;
        int n;
        cin >> n;
        vector<int> a(n);
        bool fl = true;
        int sum = 0;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            sum += a[i];
            if (a[i] < 0) fl = false;
        }
        if (n == 1) {
            cout << a[0] << endl;
            continue;
        }
        if (fl) {
            cout << sum << endl;
        }
        for (int j = n-1; j > 0; j--) {
            for (int i = 0; i < j; i++)
                a[i] = a[i+1] - a[i];
        }
        cout << abs(a[0]) << endl;
    }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

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

using namespace std;
const int MAX = 1e18;

signed main() {
    int t;
    cin >> t;
    while (t) {
            t--;
        int n;
        cin >> n;
        vector<int> a(n);
        bool fl = true;
        int sum = 0;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            sum += a[i];
            if (a[i] < 0) fl = false;
        }
        if (n == 1) {
            cout << a[0] << endl;
            continue;
        }
        if (fl) {
            cout << sum << endl;
        }
        for (int j = n-1; j > 0; j--) {
            for (int i = 0; i < j; i++)
                a[i] = a[i+1] - a[i];
        }
        cout << abs(a[0]) << endl;
    }
}


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define int long long

using namespace std;
const int MAX = 1e18;

signed main() {
    int t;
    cin >> t;
    while (t) {
            t--;
        int n;
        cin >> n;
        vector<int> a(n);
        bool fl = true;
        int sum = 0;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            sum += a[i];
            if (a[i] <= 0) fl = false;
        }
        if (n == 1) {
            cout << a[0] << endl;
            continue;
        }
        if (fl) {
            cout << sum << endl;
            continue;
        }
        for (int j = n-1; j > 0; j--) {
            for (int i = 0; i < j; i++)
                a[i] = a[i+1] - a[i];
        }
        cout << abs(a[0]) << endl;
    }
}
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(), (x).end()
#define lc(x) (x) << 1
#define rc(x) (x) << 1 | 1
#define midi(x, y) ((x) + (y)) >> 1
#define F first
#define S second
#define fast_io                                                                \
  ios::sync_with_stdio(false);                                                 \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define file_io                                                                \
  freopen("in.txt", "r+", stdin);                                              \
  freopen("out.txt", "w+", stdout);
ll poww(ll a, ll b, ll md) {
  ll ans = 1;
  for (; b; b >>= 1, a = a * a % md) {
    if (b & 1) {
      ans = ans * a % md;
    }
  }
  return ans % md;
}

const int MAXN = 1e3 + 10;
const int MAXLG = 18;
const int MOD = 1e9 + 7;
const int MOD2 = 998244353;
const ll INF = 8e18;

int c[MAXN];

int main() {
  fast_io;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
  }
  vector<pii> res;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if(c[i] < c[j]) {
        res.push_back({c[j],c[i]});
      }
      res.push_back({c[i], c[j]});
    }
  }
  cout << res.size() << endl;
  for(auto x : res) {
    cout << x.F << " " << x.S << endl;
  }
}