Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <iomanip>
#include <string>
#include <sstream>
//#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
/*struct shi
{
    int x;
    int T;
} s[100000];
int cmp(shi a,shi b)
{
    return a.x<b.x;
}
long long cmd(long long a, long long  b)
{
    return a > b;
}*/
/*typedef struct node {
    string name;
    int score;
    //struct node *next;

}student[1000000];
/*student * creatlist(int b){
    student *head = new student;
    student *pre = head;
    for(int i=1;i<=b;i++){
        student *p = new student ;
        p->num = i;
        pre->next = p;
        pre = p;
        p->next = NULL;
    }
    pre->next = head->next;//quan
    return head;

};*/
/*void kill(struct node *head){
    student *p ;
    p = head->next;
    do{
        for(int i=1;i<=4;i++){
            head = head->next;
            //sum++;
        }
            //return;
        p=head->next;
        head->next = head->next->next;
       // p=head;
        sum++;
        //cout<<p->num;
    }while(p->num!=1);
    //cout<<p->num<<endl;
    cout<<sum<<endl;
}*/

int main()
{
    int t;
    cin>>t;
    vector<int> num;
    for(int i=0; i<t; i++)
    {
        int wo;
        cin >>wo;
        num.push_back(wo);
    }
    int sum=0,time=0,time2=0;
    for(int i=0; i<t; i++)
    {
        sum+=num[i];
        if(i==0)
        {
            if(sum<=0)
            {
                time+=abs(num[i])+1;
                sum=1;
            }
        }
        else if(i%2==0&&i!=0)
        {
            if(sum<0)
            {
                if(sum==2*num[i])
                {
                    time+=abs(sum)+1;
                    sum=1;
                }
                else
                {
                    time+=abs(sum-1);
                    sum=1;
                }
            }
            else if(sum==0)
            {
                sum=1;
                time+=1;
            }

    }
    else if(i%2==1)
    {
        if(sum>0)
        {
            if(sum==2*num[i])
            {
                time+=abs(sum)+1;
                sum=-1;
            }
            else if(sum==1&&num[i]==0)
            {
                time+=2;
                sum=-1;
            }
            else
            {
                time+=abs(sum-1);
                sum=-1;
            }

        }
        else if(sum==0)
        {
            sum=-1;
            time+=1;
        }
    }
    //cout<<time<<endl;
}
//cout<<time<<endl;
sum=0;
for(int i=0; i<t; i++)
{
    sum+=num[i];
    if(i==0)
    {
        if(sum=>0)
        {
            time2+=abs(num[i])+1;
            sum=-1;
        }
    }
    else if(i%2!=0&&i!=0)
    {
        if(sum<0)
        {
            if(sum==2*num[i])
            {
                time2+=abs(sum)+1;
                sum=1;
            }
            else
            {
                time2+=abs(sum-1);
                sum=1;
            }

        }
        else if(sum==0)
        {
            sum=1;
            time2+=1;
        }
    }
    else if(i%2==1)
    {
        //cout<<sum<<"jk"<<endl;
        if(sum>0)
        {
            if(sum==2*num[i])
            {
                time2+=abs(sum)+1;
                sum=-1;
                //cout<<sum<<"ehiu"<<endl;
            }
            else if(sum==1&&num[i]==0)
            {
                time2+=2;
                sum=-1;
            }
            else
            {
                time2+=abs(sum-1);
                sum=-1;
            }

        }
        else if(sum==0)
        {
            sum=-1;
            time2+=1;
        }
    }
    //cout<<time2<<endl;
}
//cout<<time<<" "<<time2<<endl;
int mi = min(time,time2);
cout<<mi<<endl;
return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:145:16: error: expected primary-expression before '>' token
  145 |         if(sum=>0)
      |                ^