ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2057C - Trip to the Olympiad
Language: PyPy 3-64


Submission (verdict: Wrong answer on test 1):
# cook your dish here
for _ in range(int(input())):
    min_val, max_val = map(int, input().split())
    
    def decimalToBinary(n): 
        return bin(n).replace("0b", "")
        
    def binaryToDecimal(n):
        return int(str(n),2)
    
    min_bin = [*decimalToBinary(min_val)]
    max_bin = [*decimalToBinary(max_val)]
    
    while len(min_bin) != len(max_bin):
        min_bin.insert(0, '0')
    
    a_bin = []
    b_bin = []
    
    for i,j in zip(min_bin, max_bin):
        if i != j:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            for i in range(len(min_bin)):
                if j == "1":
                    a_bin.append('1')
                    b_bin.append('0')
                else:
                    a_bin.append('0')
                    b_bin.append('1')
            break
        else:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            
    f_a = binaryToDecimal("".join(a_bin))
    f_b = binaryToDecimal("".join(b_bin))
    f_c = min(f_a, f_b) +1
    for i in range(min_val, max_val+1):
        if (i != f_a and i != f_b):
            f_c = i
            break
    
    print(f_a, f_b, f_c)
Problem: 2057C - Trip to the Olympiad
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 1):
# cook your dish here
for _ in range(int(input())):
    min_val, max_val = map(int, input().split())
    
    def decimalToBinary(n): 
        return bin(n).replace("0b", "")
        
    def binaryToDecimal(n):
        return int(str(n),2)
    
    min_bin = [*decimalToBinary(min_val)]
    max_bin = [*decimalToBinary(max_val)]
    
    while len(min_bin) != len(max_bin):
        min_bin.insert(0, '0')
    
    a_bin = []
    b_bin = []
    
    for i,j in zip(min_bin, max_bin):
        if i != j:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            for i in range(len(min_bin)-1):
                if int("".join(a_bin)) < int("".join(b_bin)):
                    a_bin.append('1')
                    b_bin.append('0')
                else:
                    a_bin.append('0')
                    b_bin.append('1')
            break
        else:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            
    # print(min_bin, max_bin)
    # print(a_bin, b_bin)
            
    f_a = binaryToDecimal("".join(a_bin))
    f_b = binaryToDecimal("".join(b_bin))
    f_c = min(f_a, f_b) +1
    for i in range(min_val, max_val+1):
        if (i != f_a and i != f_b):
            f_c = i
            break
    
    print(f_a, f_b, f_c)

Submission (verdict: Wrong answer on test 1):
# cook your dish here
for _ in range(int(input())):
    min_val, max_val = map(int, input().split())
    
    def decimalToBinary(n): 
        return bin(n).replace("0b", "")
        
    def binaryToDecimal(n):
        return int(str(n),2)
    
    min_bin = [*decimalToBinary(min_val)]
    max_bin = [*decimalToBinary(max_val)]
    
    while len(min_bin) != len(max_bin):
        min_bin.insert(0, '0')
    
    a_bin = []
    b_bin = []
    
    for i,j in zip(min_bin, max_bin):
        if i != j:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            for i in range(len(min_bin)-1):
                if int("".join(a_bin)) > int("".join(b_bin)):
                    a_bin.append('1')
                    b_bin.append('0')
                else:
                    a_bin.append('0')
                    b_bin.append('1')
            break
        else:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            
    # print(min_bin, max_bin)
    # print(a_bin, b_bin)
            
    f_a = binaryToDecimal("".join(a_bin))
    f_b = binaryToDecimal("".join(b_bin))
    f_c = min(f_a, f_b) +1
    for i in range(min_val, max_val+1):
        if (i != f_a and i != f_b):
            f_c = i
            break
    
    print(f_a, f_b, f_c)
Problem: 2057C - Trip to the Olympiad
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 1):
# cook your dish here
for _ in range(int(input())):
    min_val, max_val = map(int, input().split())
    
    def decimalToBinary(n): 
        return bin(n).replace("0b", "")
        
    def binaryToDecimal(n):
        return int(str(n),2)
    
    min_bin = [*decimalToBinary(min_val)]
    max_bin = [*decimalToBinary(max_val)]
    
    while len(min_bin) != len(max_bin):
        min_bin.insert(0, '0')
    
    a_bin = []
    b_bin = []
    
    for i,j in zip(min_bin, max_bin):
        if i != j:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            for i in range(len(min_bin)):
                if j == "1":
                    a_bin.append('1')
                    b_bin.append('0')
                else:
                    a_bin.append('0')
                    b_bin.append('1')
            break
        else:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            
    f_a = binaryToDecimal("".join(a_bin))
    f_b = binaryToDecimal("".join(b_bin))
    f_c = min(f_a, f_b) +1
    for i in range(min_val, max_val+1):
        if (i != f_a and i != f_b):
            f_c = i
            break
    
    print(f_a, f_b, f_c)

Submission (verdict: Wrong answer on test 1):
# cook your dish here
for _ in range(int(input())):
    min_val, max_val = map(int, input().split())
    
    def decimalToBinary(n): 
        return bin(n).replace("0b", "")
        
    def binaryToDecimal(n):
        return int(str(n),2)
    
    min_bin = [*decimalToBinary(min_val)]
    max_bin = [*decimalToBinary(max_val)]
    
    while len(min_bin) != len(max_bin):
        min_bin.insert(0, '0')
    
    a_bin = []
    b_bin = []
    
    for i,j in zip(min_bin, max_bin):
        if i != j:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            for i in range(len(min_bin)-1):
                if int("".join(a_bin)) < int("".join(b_bin)):
                    a_bin.append('1')
                    b_bin.append('0')
                else:
                    a_bin.append('0')
                    b_bin.append('1')
            break
        else:
            a_bin.append(str(i))
            b_bin.append(str(j))
            min_bin.pop(0)
            max_bin.pop(0)
            
    # print(min_bin, max_bin)
    # print(a_bin, b_bin)
            
    f_a = binaryToDecimal("".join(a_bin))
    f_b = binaryToDecimal("".join(b_bin))
    f_c = min(f_a, f_b) +1
    for i in range(min_val, max_val+1):
        if (i != f_a and i != f_b):
            f_c = i
            break
    
    print(f_a, f_b, f_c)
Problem: 2057C - Trip to the Olympiad
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 1):
# cook your dish here
for _ in range(int(input())):
    min_val, max_val = map(int, input().split())
    
    def decimalToBinary(n): 
        return bin(n).replace("0b", "")
        
    def binaryToDecimal(n):
        return int(str(n),2)
    
    min_bin = [*decimalToBinary(min_val)]
    max_bin = [*decimalToBinary(max_val)]
    
    while len(min_bin) != len(max_bin):
        min_bin.insert(0, '0')
    
    a_bin = []
    b_bin = []
    
    # print(min_bin, max_bin)
    
    for k in range(len(max_bin)):
        i = min_bin[k]
        j = max_bin[k]
        if i != j:
            a_bin.append(str(i))
            b_bin.append(str(j))
            for i in range(len(max_bin) - len(a_bin)):
                if int("".join(a_bin)) < int("".join(b_bin)):
                    a_bin.append('1')
                    b_bin.append('0')
                else:
                    a_bin.append('0')
                    b_bin.append('1')
            break
        else:
            a_bin.append(str(i))
            b_bin.append(str(j))
    
    # print(a_bin, b_bin)
            
    f_a = binaryToDecimal("".join(a_bin))
    f_b = binaryToDecimal("".join(b_bin))
    f_c = min(f_a, f_b) +1
    for i in range(min_val, max_val+1):
        if (i != f_a and i != f_b):
            f_c = i
            break
    
    print(f_a, f_b, f_c)

Submission (verdict: Accepted):

// "Oyyyy...she has a gold which is black"


#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
//using namespace __gnu_pbds;

//typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> ordered_set;


#define endl "\n"
#define int long long




void solve() { 
    int l,r; cin>>l>>r; 
    int k; 
    for (int i=30;i>=0;i--) {
        if ((r&(1LL<<i))!=(l&(1LL<<i))) {
            k=i; 
            break;
        }
    }
    //cout<<k<<endl;
    int x=0; 
    for (int i=30;i>=k;i--) {
        if (r&(1LL<<i)) {
            x+=(1LL<<i);
        }
    }
    int y=x-1; 
    cout<<x<<" "<<y<<" "; 
    if (y==l) {
        cout<<r<<endl;
    }
    else {
        cout<<l<<endl;
    }
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
        
    
    int tc=1; 
    cin>>tc; 
    while (tc--) {
        solve();
    }
    
 
    return 0;

}   
 


/* 

        “What is happening is actually terrifying. I mean what happened to me all on a sudden?”

                         
                                                                                                              
*/
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 endl '\n'
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
const int mod =1e9+7;


void vg(){
    
    int a,b;cin>>a>>b;
    
    int bitr=(int)log2(b);
    
    int x=1ll<<bitr;
  
    if(x==b){
        cout<<x<<" "<<x-1<<" "<<x-2<<endl;
        return;
    }
    
    cout<<x-1<<" "<<x<<" "<<x+1<<endl;
}

signed main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int t=1;
    cin>>t;
    while(t--){
        vg();
    }
}
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 endl '\n'
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
const int mod =1e9+7;


void vg(){
    
    int a,b;cin>>a>>b;
    
    int bitr=(int)log2(b);
    
    int x=1ll<<bitr;
  
    if(x==b){
        cout<<x<<" "<<x-1<<" "<<x-2<<endl;
        return;
    }
    
    cout<<x-1<<" "<<x<<" "<<x+1<<endl;
}

signed main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int t=1;
    cin>>t;
    while(t--){
        vg();
    }
}

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

#define int long long
#define endl '\n'
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
const int mod =1e9+7;


void vg(){
    
    int l,r;cin>>l>>r;
    
    int a=0;
    for(int i=30;i>=0;i--){
        
        if(r&(1ll<<i))a|=1ll<<i;
        
        if(l&(1ll<<i)<r&(1ll<<i)){
            break;
        }
    }
    
    if(a==r){
        cout<<a<<" "<<a-1<<" "<<a-2<<endl;
        return;
    }
    
    cout<<a<<" "<<a-1<<" "<<a+1<<endl;
    
}

signed main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int t=1;
    cin>>t;
    while(t--){
        vg();
    }
}
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 endl '\n'
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
const int mod =1e9+7;


void vg(){
    
    int l,r;cin>>l>>r;
    
    int a=0;
    for(int i=30;i>=0;i--){
        
        if(r&(1ll<<i))a|=1ll<<i;
        
        if(l&(1ll<<i)<r&(1ll<<i)){
            break;
        }
    }
    
    if(a==r){
        cout<<a<<" "<<a-1<<" "<<a-2<<endl;
        return;
    }
    
    cout<<a<<" "<<a-1<<" "<<a+1<<endl;
    
}

signed main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int t=1;
    cin>>t;
    while(t--){
        vg();
    }
}

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

#define int long long
#define endl '\n'
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
const int mod =1e9+7;


void vg(){
    
    int l,r;cin>>l>>r;
    
    int a=0;
    for(int i=30;i>=0;i--){
        
        if(r&(1ll<<i))a|=1ll<<i;
        
        if((l&(1ll<<i))<(r&(1ll<<i))){
            break;
        }
    }
    
    if(a==r){
        cout<<a<<" "<<a-1<<" "<<a-2<<endl;
        return;
    }
    
    cout<<a<<" "<<a-1<<" "<<a+1<<endl;
    
}

signed main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int t=1;
    cin>>t;
    while(t--){
        vg();
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

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

int do_it(int a, int b, int c, vector<int> &pos, int cp){
    if(a<b && b<c) return b;
    int n = pos.size();
    if(cp>=n) return -1;
    int ans = do_it(a, b, c, pos, cp+1);
    if(ans!=-1) return ans;
    if(b & (1<<(pos[cp]))){
        b&=~(1<<(pos[cp]));
    }else{
        b|=(1<<(pos[cp]));
    }
    ans = do_it(a, b, c, pos, cp+1);
    return ans;

}

signed main(){
    int T; cin>>T;
    while(T--){
        int l, r; cin>>l>>r;
        int a{l}, b{0}, c{r};
        bool comp = false;
        vector<int> pos;
        for(int i = 30;i>=0;i--){
            bool f = a & (1<<i);
            bool s = c & (1<<i);
            if(f != s) comp = true;
            if(!comp){
                b|=((f)<<i);
            }else{
                if(f^s) pos.push_back(i);
                if(!f & !s) b|=(1<<i); 
            }
        }
        while(b<=a){
            b|=(1<<pos[0]);
            pos.erase(pos.begin());
        }

        cout<<a<<' '<<b<<' '<<c<<'\n';

    }

    return 0;
}

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

int do_it(int a, int b, int c, vector<int> &pos, int cp){
    if(a<b && b<c) return b;
    int n = pos.size();
    if(cp>=n) return -1;
    int ans = do_it(a, b, c, pos, cp+1);
    if(ans!=-1) return ans;
    if(b & (1<<(pos[cp]))){
        b&=~(1<<(pos[cp]));
    }else{
        b|=(1<<(pos[cp]));
    }
    ans = do_it(a, b, c, pos, cp+1);
    return ans;

}

signed main(){
    int T; cin>>T;
    while(T--){
        int l, r; cin>>l>>r;
        int a{l}, b{0}, c{r};
        bool comp = false;
        vector<int> pos;
        for(int i = 30;i>=0;i--){
            bool f = a & (1<<i);
            bool s = c & (1<<i);
            if(f != s) comp = true;
            if(!comp){
                b|=((f)<<i);
            }else{
                if(f^s) pos.push_back(i);
                if(!f & !s) b|=(1<<i); 
            }
        }
        while(b<=a){
            b|=(1<<pos.back());
            pos.pop_back();
        }

        cout<<a<<' '<<b<<' '<<c<<'\n';

    }

    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

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

int do_it(int a, int b, int c, vector<int> &pos, int cp){
    if(a<b && b<c) return b;
    int n = pos.size();
    if(cp>=n) return -1;
    int ans = do_it(a, b, c, pos, cp+1);
    if(ans!=-1) return ans;
    if(b & (1<<(pos[cp]))){
        b&=~(1<<(pos[cp]));
    }else{
        b|=(1<<(pos[cp]));
    }
    ans = do_it(a, b, c, pos, cp+1);
    return ans;

}

signed main(){
    int T; cin>>T;
    while(T--){
        int l, r; cin>>l>>r;
        int a{l}, b{0}, c{r};
        bool comp = false;
        vector<int> pos;
        for(int i = 30;i>=0;i--){
            bool f = a & (1<<i);
            bool s = c & (1<<i);
            if(f != s) comp = true;
            if(!comp){
                b|=((f)<<i);
            }else{
                if(f^s) pos.push_back(i);
                if(!f & !s) b|=(1<<i); 
            }
        }
        while(b<=a){
            b|=(1<<pos.back());
            pos.pop_back();
        }

        cout<<a<<' '<<b<<' '<<c<<'\n';

    }

    return 0;
}

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

int do_it(int a, int b, int c, vector<int> &pos, int cp){
    if(a<b && b<c) return b;
    int n = pos.size();
    if(cp>=n) return -1;
    int ans = do_it(a, b, c, pos, cp+1);
    if(ans!=-1) return ans;
    if(b & (1<<(pos[cp]))){
        b&=~(1<<(pos[cp]));
    }else{
        b|=(1<<(pos[cp]));
    }
    ans = do_it(a, b, c, pos, cp+1);
    return ans;

}

signed main(){
    int T; cin>>T;
    while(T--){
        int l, r; cin>>l>>r;
        int a{l}, b{0}, c{r};
        bool comp = false;
        vector<int> pos; int A;
        for(int i = 30;i>=0;i--){
            bool f = a & (1<<i);
            bool s = c & (1<<i);
            if(f != s) {
                A = i;
                comp = true;
                break;    
            }
            
        }
        for(int i = A-1;i>=0;i--){
            a|=(1<<i);
            c&=(~(1<<i));
        }
        if(a!=l && c!=l) b = l;
        else if(a!=r && c!=r) b = r;
        else b=l+1;
        cout<<a<<' '<<b<<' '<<c<<'\n';

    }

    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

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

int do_it(int a, int b, int c, vector<int> &pos, int cp){
    if(a<b && b<c) return b;
    int n = pos.size();
    if(cp>=n) return -1;
    int ans = do_it(a, b, c, pos, cp+1);
    if(ans!=-1) return ans;
    if(b & (1<<(pos[cp]))){
        b&=~(1<<(pos[cp]));
    }else{
        b|=(1<<(pos[cp]));
    }
    ans = do_it(a, b, c, pos, cp+1);
    return ans;

}

signed main(){
    int T; cin>>T;
    while(T--){
        int l, r; cin>>l>>r;
        int a{l}, b{0}, c{r};
        bool comp = false;
        vector<int> pos;
        for(int i = 30;i>=0;i--){
            bool f = a & (1<<i);
            bool s = c & (1<<i);
            if(f != s) comp = true;
            if(!comp){
                b|=((f)<<i);
            }else{
                if(f^s) pos.push_back(i);
                if(!f & !s) b|=(1<<i); 
            }
        }
        b = do_it(a, b, c, pos, 0);
        cout<<a<<' '<<b<<' '<<c<<'\n';

    }

    return 0;
}

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

int do_it(int a, int b, int c, vector<int> &pos, int cp){
    if(a<b && b<c) return b;
    int n = pos.size();
    if(cp>=n) return -1;
    int ans = do_it(a, b, c, pos, cp+1);
    if(ans!=-1) return ans;
    if(b & (1<<(pos[cp]))){
        b&=~(1<<(pos[cp]));
    }else{
        b|=(1<<(pos[cp]));
    }
    ans = do_it(a, b, c, pos, cp+1);
    return ans;

}

signed main(){
    int T; cin>>T;
    while(T--){
        int l, r; cin>>l>>r;
        int a{l}, b{0}, c{r};
        bool comp = false;
        vector<int> pos;
        for(int i = 30;i>=0;i--){
            bool f = a & (1<<i);
            bool s = c & (1<<i);
            if(f != s) comp = true;
            if(!comp){
                b|=((f)<<i);
            }else{
                if(f^s) pos.push_back(i);
                if(!f & !s) b|=(1<<i); 
            }
        }
        while(b<=a){
            b|=(1<<pos[0]);
            pos.erase(pos.begin());
        }

        cout<<a<<' '<<b<<' '<<c<<'\n';

    }

    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


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

int do_it(int a, int b, int c, vector<int> &pos, int cp){
    if(a<b && b<c) return b;
    int n = pos.size();
    if(cp>=n) return -1;
    int ans = do_it(a, b, c, pos, cp+1);
    if(ans!=-1) return ans;
    if(b & (1<<(pos[cp]))){
        b&=~(1<<(pos[cp]));
    }else{
        b|=(1<<(pos[cp]));
    }
    ans = do_it(a, b, c, pos, cp+1);
    return ans;

}

signed main(){
    int T; cin>>T;
    while(T--){
        int l, r; cin>>l>>r;
        int a{l}, b{0}, c{r};
        bool comp = false;
        vector<int> pos;
        for(int i = 30;i>=0;i--){
            bool f = a & (1<<i);
            bool s = c & (1<<i);
            if(f != s) comp = true;
            if(!comp){
                b|=((f)<<i);
            }else{
                if(f^s) pos.push_back(i);
                if(!f & !s) b|=(1<<i); 
            }
        }
        b = do_it(a, b, c, pos, 0);
        cout<<a<<' '<<b<<' '<<c<<'\n';

    }

    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<map>
using namespace std;
int summ(vector<int> & v){

    int sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    return abs(sum);
}
int main(){
    int t;
    cin>>t;
    for(int i=1;i<=t;i++){
        int n;
        cin>>n;
        vector<int> v(n);
        bool f = true;
        int maxsum = 0;
        for(int i=0;i<n;i++){
            cin>>v[i];
        }
        for(int i=0;i<n;i++){
            maxsum+=v[i];
        }
        while(v.size()>1){
            vector<int> newv;
            for(int i=0;i<v.size()-1;i++){
                newv.push_back(v[i+1]-v[i]);
            }
            v = newv;
            maxsum = max(maxsum,summ(v));
        }
        cout<<maxsum<<endl;
    }
}

Submission (verdict: Compilation error):
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<map>
using namespace std;
int summ(vector<int> & v){

    int sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    return abs(sum);
}
int main(){
    int t;
    cin>>t;
    for(int i=1;i<=t;i++){
        int n;
        cin>>n;
        vector<long long> v(n);
        int maxsum = 0;
        for(int i=0;i<n;i++){
            cin>>v[i];
        }
        for(int i=0;i<n;i++){
            maxsum+=v[i];
        }
        while(v.size()>1){
            vector<long long> newv;
            for(int i=0;i<v.size()-1;i++){
                newv.push_back(v[i+1]-v[i]);
            }
            v = newv;

            maxsum = max(maxsum,summ(v));
        }
        cout<<maxsum<<endl;
    }
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<map>
using namespace std;
int summ(vector<int> & v){

    int sum = 0;
    for(int i=0;i<v.size();i++){
        sum+=v[i];
    }
    return abs(sum);
}
int main(){
    int t;
    cin>>t;
    for(int i=1;i<=t;i++){
        int n;
        cin>>n;
        vector<int> v(n);
        bool f = true;
        int maxsum = 0;
        for(int i=0;i<n;i++){
            cin>>v[i];
        }
        for(int i=0;i<n;i++){
            maxsum+=v[i];
        }
        while(v.size()>1){
            vector<int> newv;
            for(int i=0;i<v.size()-1;i++){
                newv.push_back(v[i+1]-v[i]);
            }
            v = newv;
            maxsum = max(maxsum,summ(v));
        }
        cout<<maxsum<<endl;
    }
}