ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2061D - Kevin and Numbers
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Compilation error):
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
int main(int argc, char const *argv[])
{
  int T,n,m;
  for(std::cin>>T;T!=0;--T){
    std::cin>>n>>m;
    std::map<int,int> origin;
    long long ogsum=0;
    for(int cx=0,og;cx!=n;++cx){
      std::cin>>og;
      ++origin[og];
      ogsum+=og;
    }
    std::queue<int> queries;
    long long tgsum=0;
    for(int cx=0,tg;cx!=m;++cx){
      std::cin>>tg;
      queries.push(tg);
      tgsum+=og;
    }
    bool valid=tgsum==ogsum;
    while(!queries.empty()&&valid){
      tg=queries.front();
      queries.pop();
      if(tg==0||static_cast<int>(queries.size())>n){
        valid=false;
        break;
      }else if(origin.find(tg)!=origin.end()&&origin[tg]>0) 
        --origin[tg];
      else queries.push(tg>>1),queries.push((tg+1)>>1);
    }
    for(auto &&[cx,ct]:origin)
      if(ct!=0) valid=false;
    if(valid) std::cout<<"Yes"<<std::endl;
    else std::cout<<"No"<<std::endl;
  }
  return 0;
}

Submission (verdict: Accepted):
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
int main(int argc, char const *argv[])
{
  int T,n,m;
  for(std::cin>>T;T!=0;--T){
    std::cin>>n>>m;
    std::map<int,int> origin;
    long long ogsum=0;
    for(int cx=0,og;cx!=n;++cx){
      std::cin>>og;
      ++origin[og];
      ogsum+=og;
    }
    std::queue<int> queries;
    long long tgsum=0;
    for(int cx=0,tg;cx!=m;++cx){
      std::cin>>tg;
      queries.push(tg);
      tgsum+=tg;
    }
    bool valid=tgsum==ogsum;
    while(!queries.empty()&&valid){
      int tg=queries.front();
      queries.pop();
      if(tg==0||static_cast<int>(queries.size())>n){
        valid=false;
        break;
      }else if(origin.find(tg)!=origin.end()&&origin[tg]>0) 
        --origin[tg];
      else queries.push(tg>>1),queries.push((tg+1)>>1);
    }
    for(auto &&[cx,ct]:origin)
      if(ct!=0) valid=false;
    if(valid) std::cout<<"Yes"<<std::endl;
    else std::cout<<"No"<<std::endl;
  }
  return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Time limit exceeded on test 25):
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
int main(int argc, char const *argv[])
{
  int T,n,m;
  for(std::cin>>T;T!=0;--T){
    std::cin>>n>>m;
    std::map<int,int> origin;
    for(int cx=0,og;cx!=n;++cx){
      std::cin>>og;
      ++origin[og];
    }
    bool valid=true;
    for(int cx=0,tg;cx!=m;++cx){
      std::queue<int> queries;
      std::cin>>tg;
      queries.push(tg);
      while(!queries.empty()){
        tg=queries.front();
        queries.pop();
        if(tg==0||static_cast<int>(queries.size())>n){
          valid=false;
          break;
        }else if(origin.find(tg)!=origin.end()&&origin[tg]>0) 
          --origin[tg],--n;
        else queries.push(tg>>1),queries.push((tg+1)>>1);
      }
    }
    for(auto &&[cx,ct]:origin)
      if(ct!=0) valid=false;
    if(valid) std::cout<<"Yes"<<std::endl;
    else std::cout<<"No"<<std::endl;
  }
  return 0;
}
Problem: 2050D - Digital string maximization
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Compilation error):
#include <bits/stdc++.h> // include all standard headers
using namespace std;

#define ll long long
#define ld long double
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // Declare any additional variables here
    
    int k; // number of test cases
    cin >> k;
    
    while (k--) {
        // write your code here for each test case
        string s;
        cin>>s;
        ll n=s.size();
        for(ll j=0;j<10;j++){
           
        for(ll i=1;i<n;i++){
            
            if((s[i]!='0')&&s[i]-s[i-1]>1){
                int temp=s[i-1];
                s[i-1]=s[i]-1;
                s[i]=temp;
                
            }
        }
        
        cout<<s<<endl;
    }
    
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h> // include all standard headers
using namespace std;

#define ll long long
#define ld long double
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // Declare any additional variables here
    
    int k; // number of test cases
    cin >> k;
    
    while (k--) {
        // write your code here for each test case
        string s;
        cin>>s;
        ll n=s.size();
        for(ll j=0;j<10;j++){
           
        for(ll i=1;i<n;i++){
            
            if((s[i]!='0')&&s[i]-s[i-1]>1){
                char temp=s[i-1];
                s[i-1]=s[i]-1;
                s[i]=temp;
                
            }
        }
        }
        cout<<s<<endl;
    }
    
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Compilation error):
#include <bits/stdc++.h> // include all standard headers
using namespace std;
 
#define ll long long
#define ld long double
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
 
const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // Declare any additional variables here
    
    int k; // number of test cases
    cin >> k;
    
    while (k--) {
        // write your code here for each test case
        string s;
        cin>>s;
        ll n=s.size();
        for(ll j=0;j<10;j++){
           
        for(ll i=1;i<n;i++){
            
            if((s[i]!='0')&&s[i]-s[i-1]>1){
                int temp=s[i-1];
                s[i-1]=s[i]-1;
                s[i]=temp;
                
            }
        }
        
        cout<<s<<endl;
    }
    
    return 0;
}

Submission (verdict: Compilation error):
#include <bits/stdc++.h> // include all standard headers
using namespace std;

#define ll long long
#define ld long double
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // Declare any additional variables here
    
    int k; // number of test cases
    cin >> k;
    
    while (k--) {
        // write your code here for each test case
        string s;
        cin>>s;
        ll n=s.size();
        for(ll j=0;j<10;j++){
           
        for(ll i=1;i<n;i++){
            
            if((s[i]!='0')&&s[i]-s[i-1]>1){
                int temp=s[i-1];
                s[i-1]=s[i]-1;
                s[i]=temp;
                
            }
        }
        
        cout<<s<<endl;
    }
    
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Compilation error):
#include <bits/stdc++.h> // include all standard headers
using namespace std;
 
#define ll long long
#define ld long double
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
 
const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // Declare any additional variables here
    
    int k; // number of test cases
    cin >> k;
    
    while (k--) {
        // write your code here for each test case
        string s;
        cin>>s;
        ll n=s.size();
        for(ll j=0;j<10;j++){
           
        for(ll i=1;i<n;i++){
            
            if((s[i]!='0')&&s[i]-s[i-1]>1){
                int temp=s[i-1];
                s[i-1]=s[i]-1;
                s[i]=temp;
                
            }
        }
        
        cout<<s<<endl;
    }
    
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<int> place(n);
    for(int i=0; i<n; i++)
        cin >> place[i];
    
    vector<pair<int, int>> ans;
    vector<bool> vis(n, false);
    for(int i=place.size()-1; i>=0; i--) {
        int x = place[i], y = i;
        while(--x > 0)
            ans.push_back({place[i], x});
            
        while(y--) {
            x++;
            ans.push_back({x, place[i]});
        }
    }
    
    cout << ans.size() << endl;
    for(auto x : ans)
        cout << x.first << ' ' << x.second << endl;
        
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<int> place(n);
    for(int i=0; i<n; i++)
        cin >> place[i];
    
    vector<pair<int, int>> ans;
    vector<bool> vis(n, false);
    for(int i=place.size()-1; i>=0; i--) {
        int x = place[i], y = i;
        while((--x) > 0)
            ans.push_back({place[i], x});
            
        while(y--) {
            x++;
            ans.push_back({x, place[i]});
        }
    }
    
    cout << ans.size() << endl;
    for(auto x : ans)
        cout << x.first << ' ' << x.second << endl;
        
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<int> place(n);
    for(int i=0; i<n; i++)
        cin >> place[i];
    
    vector<pair<int, int>> ans;
    vector<bool> vis(n, false);
    for(int i=place.size()-1; i>=0; i--) {
        int x = place[i]-1, y = i;
        while((--x) > 0)
            ans.push_back({place[i], x});
            
        while(y--) {
            x++;
            if(x == place[i])
                x++;
            ans.push_back({x, place[i]});
        }
    }
    
    cout << ans.size() << endl;
    for(auto x : ans)
        cout << x.first << ' ' << x.second << endl;
        
    return 0;
}

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

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> place(n);
    for (int i = 0; i < n; i++)
        cin >> place[i];

    vector<pair<int, int>> ans;
    vector<bool> vis(n+1, false);
    for (int i = place.size() - 1; i >= 0; i--) {
        int x = place[i]-1, y = i;
        vis[place[i]] = true;
        while (x > 0) {
            if (!vis[x]) {
                ans.push_back({ place[i], x });
                //cout << place[i] << ' ' << x << endl;
            }
            x--;
        }

        //cout << "---------" << endl;

        while (y) {
            x++;
            if (vis[x])
                continue;
            ans.push_back({ x, place[i] });
            //cout << x << ' ' << place[i] << endl;
            y--;
        }

        cout << endl;
    }

    cout << ans.size() << endl;
    for (auto x : ans)
        cout << x.first << ' ' << x.second << endl;

    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

Previous submission (verdict: Compilation error):
#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> place(n);
    for(int i=0; i<n; i++)
        cin >> place[i];
    
    vector<pair<int, int>> ans;
    vector<bool> vis(n, false);
    for(int i=place.size()-1; i>=0; i--) {
        int x = place[i], y = i;
        while(--x > 0)
            ans.push_back({place[i], x});
            
        while(y--) {
            x++;
            ans.push_back({x, place[i]});
        }
    }
    
    cout << ans.size() << endl;
    for(auto x : ans)
        cout << x.first << ' ' << ans.second << endl;
        
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<int> place(n);
    for(int i=0; i<n; i++)
        cin >> place[i];
    
    vector<pair<int, int>> ans;
    vector<bool> vis(n, false);
    for(int i=place.size()-1; i>=0; i--) {
        int x = place[i], y = i;
        while(--x > 0)
            ans.push_back({place[i], x});
            
        while(y--) {
            x++;
            ans.push_back({x, place[i]});
        }
    }
    
    cout << ans.size() << endl;
    for(auto x : ans)
        cout << x.first << ' ' << x.second << endl;
        
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<int> place(n);
    for(int i=0; i<n; i++)
        cin >> place[i];
    
    vector<pair<int, int>> ans;
    vector<bool> vis(n, false);
    for(int i=place.size()-1; i>=0; i--) {
        int x = place[i], y = i;
        while((--x) > 0)
            ans.push_back({place[i], x});
            
        while(y--) {
            x++;
            ans.push_back({x, place[i]});
        }
    }
    
    cout << ans.size() << endl;
    for(auto x : ans)
        cout << x.first << ' ' << x.second << endl;
        
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<int> place(n);
    for(int i=0; i<n; i++)
        cin >> place[i];
    
    vector<pair<int, int>> ans;
    vector<bool> vis(n, false);
    for(int i=place.size()-1; i>=0; i--) {
        int x = place[i]-1, y = i;
        while((--x) > 0)
            ans.push_back({place[i], x});
            
        while(y--) {
            x++;
            if(x == place[i])
                x++;
            ans.push_back({x, place[i]});
        }
    }
    
    cout << ans.size() << endl;
    for(auto x : ans)
        cout << x.first << ' ' << x.second << endl;
        
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)


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

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> place(n);
    for(int i=0; i<n; i++)
        cin >> place[i];
    
    vector<pair<int, int>> ans;
    vector<bool> vis(n, false);
    for(int i=place.size()-1; i>=0; i--) {
        int x = place[i], y = i;
        while(--x > 0)
            ans.push_back({place[i], x});
            
        while(y--) {
            x++;
            ans.push_back({x, place[i]});
        }
    }
    
    cout << ans.size() << endl;
    for(auto x : ans)
        cout << x.first << ' ' << ans.second << endl;
        
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(s) s.begin(), s.end()
//-------------------------------------------------------END----------
void solve(){
    int n;
    cin>>n;
    vector<int> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    int ans=0;
    for(int i=0;i<n;i++){
        ans+=v[i];
    }
    while(n>1){
        ans=max(ans,abs(v[0]-v[n-1]));
        for(int i=0;i<n-1;i++){
            v[i]=v[i+1]-v[i];
        }
        n--;
        v.pop_back();
    }
    cout<<ans<<endl;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int test=1;
    cin>>test;
    while(test--){
        solve();
    }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(s) s.begin(), s.end()
//-------------------------------------------------------END----------
void solve(){
    int n;
    cin>>n;
    vector<int> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    int ans=0;
    for(int i=0;i<n;i++){
        ans+=v[i];
    }
    while(n>1){
        ans=max(ans,abs(v[0]-v[n-1]));
        for(int i=0;i<n-1;i++){
            v[i]=v[i+1]-v[i];
        }
        n--;
        v.pop_back();
    }
    ans=max(ans,v[0]);
    cout<<ans<<endl;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int test=1;
    cin>>test;
    while(test--){
        solve();
    }
}

Submission (verdict: Accepted):
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(s) s.begin(), s.end()
//-------------------------------------------------------END----------
void solve(){
    int n;
    cin>>n;
    vector<ll> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    ll ans=0;
    for(int i=0;i<n;i++){
        ans+=v[i];
    }
    while(n>1){
        ans=max(ans,abs(v[0]-v[n-1]));
        for(int i=0;i<n-1;i++){
            v[i]=v[i+1]-v[i];
        }
        n--;
        v.pop_back();
    }
    ans=max(ans,v[0]);
    cout<<ans<<endl;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int test=1;
    cin>>test;
    while(test--){
        solve();
    }
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(s) s.begin(), s.end()
//-------------------------------------------------------END----------
void solve(){
    int n;
    cin>>n;
    vector<int> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    int ans=0;
    for(int i=0;i<n;i++){
        ans+=v[i];
    }
    while(n>1){
        ans=max(ans,abs(v[0]-v[n-1]));
        for(int i=0;i<n-1;i++){
            v[i]=v[i+1]-v[i];
        }
        n--;
        v.pop_back();
    }
    cout<<ans<<endl;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int test=1;
    cin>>test;
    while(test--){
        solve();
    }
}

Submission (verdict: Wrong answer on test 2):
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(s) s.begin(), s.end()
//-------------------------------------------------------END----------
void solve(){
    int n;
    cin>>n;
    vector<int> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    int ans=0;
    for(int i=0;i<n;i++){
        ans+=v[i];
    }
    while(n>1){
        ans=max(ans,abs(v[0]-v[n-1]));
        for(int i=0;i<n-1;i++){
            v[i]=v[i+1]-v[i];
        }
        n--;
        v.pop_back();
    }
    ans=max(ans,v[0]);
    cout<<ans<<endl;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int test=1;
    cin>>test;
    while(test--){
        solve();
    }
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Compilation error):
#include <bits/stdc++.h>
using namespace std;

long long main()
{
    long long t;
    cin >> t;
    while (t--)
    {
        long long num;
        cin >> num;

        long long twos_count = 0, threes_count = 0, sum = 0;

        while (num > 0)
        {
            long long k = num % 10;
            if (k == 2)
            {
                twos_count++;
            }
            else if (k == 3)
            {
                threes_count++;
            }
            sum += k; 
            num /= 10; 
        }
        if (sum % 9 == 0)
        {
            cout << "YES" << endl;
        }
        else
        {

            if(twos_count>5)
            {
                twos_count = 5;
            }
            if(threes_count>3)
            {
                threes_count = 3;
            }
            bool marker = false;
            long long rem = sum%9;
            for(long long i =0;i<=threes_count;i++)
            {
                for(long long j=0;j<=twos_count;j++)
                {
                    if((rem+(i*6)+(j*2))%9==0)
                    {
                        marker = true;
                        break;
                    }
                }
                if(marker)
                {
                    break;
                }
            }
            if(marker)
            {
                cout<<"YES"<<endl;
            }
            else
            {
                cout<<"NO"<<endl;
            }
        }
    }

    return 0;
}


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

int main()
{
    long long t;
    cin >> t;
    while (t--)
    {
        long long num;
        cin >> num;

        long long twos_count = 0, threes_count = 0, sum = 0;

        while (num > 0)
        {
            long long k = num % 10;
            if (k == 2)
            {
                twos_count++;
            }
            else if (k == 3)
            {
                threes_count++;
            }
            sum += k; 
            num /= 10; 
        }
        if (sum % 9 == 0)
        {
            cout << "YES" << endl;
        }
        else
        {

            if(twos_count>5)
            {
                twos_count = 5;
            }
            if(threes_count>3)
            {
                threes_count = 3;
            }
            bool marker = false;
            long long rem = sum%9;
            for(long long i =0;i<=threes_count;i++)
            {
                for(long long j=0;j<=twos_count;j++)
                {
                    if((rem+(i*6)+(j*2))%9==0)
                    {
                        marker = true;
                        break;
                    }
                }
                if(marker)
                {
                    break;
                }
            }
            if(marker)
            {
                cout<<"YES"<<endl;
            }
            else
            {
                cout<<"NO"<<endl;
            }
        }
    }

    return 0;
}