criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
const int INF = 1001001001;
const ll MOD = 1e9+7;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){std::fill((T*)array, (T*)(array+N),val);}

class CompareDist
{
public:
    bool operator()(PLL n1,PLL n2) {
				if(n1.first!=n2.first) return n1.first<n2.first;
				else return n1.second<n2.second;
    }
};


__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	int n; cin>>n;
  VL a(n); rep(i,n) cin>>a[i];
  VL cnt(n+1); rep(i,n+1) cnt[i]=0;
  if(a[0]!=0) return cout << 0 << endl;

  ll ans = 3;
  cnt[1] = 1;
  cnt[0] = 2;
  reps(i,n-1){
    ans *= cnt[a[i]];
    cnt[a[i]+1]++; cnt[a[i]]--;
    ans = (ans+MOD)%MOD;
    // cerr << ans << ' ';
  }
  cerr << endl;
  cout << ans << endl;




  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:66:32: error: cannot convert 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int' in return
   66 |   if(a[0]!=0) return cout << 0 << endl;
      |                      ~~~~~~~~~~^~~~~~~
      |                                |
      |                                std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
using ll = unsigned long long;

int main() {
  const ll mod = 1000000007;
  const ll nmax = 100000;
  ll n, a[nmax], counts[nmax];
  

  cin >> n;

  for (ll i = 0; i < n; i++) {
    cin >> a[i];
  }

  ll colors = 0;
  ll result = 1;
  
  for (ll i = 0; i < n; i++) {
    if (a[i] == 0) {
      if (colors == 3) {
        cout << 0 << endl;
        return;
      }
      result *= (3 - colors);
      result %= mod;
      colors++;

    } else {
      if (counts[a[i] - 1] - counts[a[i]] <= 0) {
        cout << 0 << endl;
        return;
      }
      result *= (counts[a[i] - 1] - counts[a[i]]);
      result %= mod;
    }

    counts[a[i]]++;
  }

  cout << result % mod << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   25 |         return;
      |         ^~~~~~
a.cc:34:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   34 |         return;
      |         ^~~~~~
Language: C++

//omajinai
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
//omajinai

signed main(){

    // omajinai
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    // omajinai

    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0;i < n;i ++){
        cin >> a.at(i);
    }

    vector<int> r(n),b(n),g(n),ans(n);

    r.at(0) = 1;
    ans.at(0) = 3;
    
    for(int i = 1;i < n;i ++){

        if(a.at(i) == r.at(i-1)){
            r.at(i) = r.at(i-1) +1;
        }else if(a.at(i) == b.at(i-1)){
            b.at(i) = b.at(i-1) +1;
        }else{
            g.at(i) = g.at(i-1) +1;
        }

        if(r.at(i) == 0){
            r.at(i) = r.at(i-1);
        }
        if(b.at(i) == 0){
            b.at(i) = b.at(i-1);
        }
        if(g.at(i) == 0){
            g.at(i) = g.at(i-1);
        }

        int x = 0;
        if(a.at(i) == r.at(i-1)){
            x ++;
        }
        if(a.at(i) == b.at(i-1)){
            x ++;
        }
        if(a.at(i) == g.at(i-1)){
            x ++;
        }

        ans.at(i) = (ans.at(i-1) * x) % 1000000007(ll);

    }

    cout << ans.at(n-1) << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:54: error: expected primary-expression before ')' token
   58 |         ans.at(i) = (ans.at(i-1) * x) % 1000000007(ll);
      |                                                      ^
a.cc:58:54: error: expression cannot be used as a function
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using llong = long long;

const int INF = 100100100;
const int MOD = 1000000007;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    llong N;
    cin >> N;
    vector<llong> A(N);
    for (llong i = 0; i < N; i++) {
        llong tmp;
        cin >> tmp;
        A[i] = tmp;
    }

    vector<llong> used(N + 1, 0); // 0番目は3,1番目に0の使用個数を入れる
    used[0] = 3;

    llong ans = 1;
    for (llong i = 0; i < N; i++) {
        llong num_index = A[i] + 1;
        if (used[num_index] == 0) {
            ans *= used[num_index - 1];
            ans %= MOD;
        } else {
            ans *= used[num_index - 1] - used[num_index]);
            ans %= MOD;
        }
        used[num_index]++;
    }

    cout << ans << "\n";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:57: error: expected ';' before ')' token
   35 |             ans *= used[num_index - 1] - used[num_index]);
      |                                                         ^
      |                                                         ;
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<iomanip>

#define DIV 1000000007

using namespace std;

long main(){
    long N;
    cin >> N;
    long A[N];

    long m = 0;
    for(long i=0; i<N; i++){
        cin >> A[i];
        m = max(m ,A[i]);
    }

    long G[m+1]; fill(G, G + m + 1, 0);

    long ans = 1;
    long cnt = 0;

    for(long i =0; i<N; i++){

        if(A[i] != 0){
            ans *= G[A[i]-1];
            ans %= DIV;
            G[A[i]-1]--;
            G[A[i]]++;
        }
        else{
            cnt++;
            G[0]++;
        }
    }
    if(cnt == 1){
        ans *= 3;
        ans %= DIV;
    }
    else{
        ans *= 6;
        ans %= DIV;
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <vector>
#define ll long long
using namespace std;

int main()
{
	int n;
	cin >> n;

	vector<int> an(n+1,0);
	int a;
	cin >> a;
	++an[a];
	ll ret = 3;
	for (ll i = 1; i < n; ++i)
	{
		cin >> a;
		if (a == 0) {
			if (an[a] == 1) {
				ret *= 2LL;
				ret = ret % 1000000007LL;
			}
			//else if (an[a] == 2) {
			//	ret *= 1;
			//}
		}
		else {
			ret *= long long(an[a - 1] - an[a]);
			ret = ret % 1000000007LL;
		}

		++an[a];
	}

	cout << ret << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:32: error: expected primary-expression before 'long'
   29 |                         ret *= long long(an[a - 1] - an[a]);
      |                                ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

// iterator
#define REP(i,from, to) for(lli i=from;i<to;i++)
#define REPE(i,from, to) for(lli i=from;i<=to;i++)
#define REP_R(i,from, to) for(lli i=from;i>to;i--)
#define REPE_R(i,from, to) for(lli i=from;i>=to;i--)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

// input
#define cin1(x)             cin >> x
#define cin2(x, y)          cin >> x >> y
#define cin3(x, y, z)       cin >> x >> y >> z
#define ncin1(n, x)         REP(i, 0, n) { cin1(x[i]); }
#define ncin2(n, x, y)      REP(i, 0, n) { cin2(x[i], y[i]); }
#define ncin3(n, x, y, z)   REP(i, 0, n) { cin3(x[i], y[i], z[i]); }
#define ncinp(n, p)         REP(i, 0, n) { lli p1,p2; cin >> p1 >> p2; p[i] = P(p1, p2); }
#define ncin1_1(n, x)       REPE(i, 1, n) { cin1(x[i]); }
#define ncin2_1(n, x, y)    REPE(i, 1, n) { cin2(x[i], y[i]); }
#define ncin3_1(n, x, y, z) REPE(i, 1, n) { cin3(x[i], y[i], z[i]); }
#define ncinp_1(n, p)       REPE(i, 1, n) { lli p1,p2; cin >> p1 >> p2; p[i] = P(p1, p2); }

// output
#define cout1(x)         cout << #x << ": " << x << endl;
#define cout2(x, y)      cout << #x << ": " << x << ", " << #y << ": " << y << endl;
#define cout3(x, y, z)   cout << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl;;
#define ncout1(n, x)     REP(i, 0, n) {cout << #x << "[" << i << "]: "<< x[i] << endl;}

#define coutp(p)         cout << #p << ":" <<  " (" << p.first << ", " << p.second << ")" << endl;

// sort
#define sort_r(x, y)        sort(x, y, greater<lli>()); // 降順(5,4,3,,,)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<lli, lli> P;
typedef tuple<lli, lli, lli> tup;
typedef vector<lli> vlli;


lli dp[100001][100001]; // := (左から i 個目までで、)赤がj、青がk、緑がl 個のときの組み合わせ
lli x[3];
lli mod = 1000000007;

lli mul(lli x, lli y) {
    return x * y % mod;
}
int main() {
    lli n;
    cin1(n);
    lli a[n];
    ncin1(n,a);

    lli ans = 3;
    x[0] = 1;
    REP(i,1,n) {
        lli count = 0;
        REP(j,0,3) {
            if (x[j] == a[i])
                count++;
        }
        ans = mul(ans, count);
        REP(j,0,3) {
            if (x[j] == a[i]) {
                x[j]++;
                break;
            }
        }
    }
    cout << ans << endl;
}



Compiler output:
/tmp/cc4upFBF.o: in function `main':
a.cc:(.text+0xde): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cc4upFBF.o
a.cc:(.text+0x114): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cc4upFBF.o
a.cc:(.text+0x16e): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cc4upFBF.o
a.cc:(.text+0x196): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cc4upFBF.o
a.cc:(.text+0x1b1): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/cc4upFBF.o
collect2: error: ld returned 1 exit status
Language: C++

#include "algorithm"
#include "iostream"
#include "numeric"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
using namespace std;
typedef long long ll;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;

template <int MOD>
class Fp {
 public:
  long long val;
  constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
    if (val < 0) v += MOD;
  }
  constexpr int getmod() { return MOD; }
  constexpr Fp operator-() const noexcept { return val ? MOD - val : 0; }
  constexpr Fp operator+(const Fp& r) const noexcept { return Fp(*this) += r; }
  constexpr Fp operator-(const Fp& r) const noexcept { return Fp(*this) -= r; }
  constexpr Fp operator*(const Fp& r) const noexcept { return Fp(*this) *= r; }
  constexpr Fp operator/(const Fp& r) const noexcept { return Fp(*this) /= r; }
  constexpr Fp& operator+=(const Fp& r) noexcept {
    val += r.val;
    if (val >= MOD) val -= MOD;
    return *this;
  }
  constexpr Fp& operator-=(const Fp& r) noexcept {
    val -= r.val;
    if (val < 0) val += MOD;
    return *this;
  }
  constexpr Fp& operator*=(const Fp& r) noexcept {
    val = val * r.val % MOD;
    return *this;
  }
  constexpr Fp& operator/=(const Fp& r) noexcept {
    long long a = r.val, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    val = val * u % MOD;
    if (val < 0) val += MOD;
    return *this;
  }
  constexpr bool operator==(const Fp& r) const noexcept {
    return this->val == r.val;
  }
  constexpr bool operator!=(const Fp& r) const noexcept {
    return this->val != r.val;
  }
  friend constexpr ostream& operator<<(ostream& os, const Fp<MOD>& x) noexcept {
    return os << x.val;
  }
  friend constexpr istream& operator>>(istream& is, Fp<MOD>& x) noexcept {
    return is >> x.val;
  }
  friend constexpr Fp<MOD> modpow(const Fp<MOD>& a, long long n) noexcept {
    if (n == 0) return 1;
    auto t = modpow(a, n / 2);
    t = t * t;
    if (n & 1) t = t * a;
    return t;
  }
};

const ll MOD = 1000000007;
using mint = Fp<MOD>;

#ifndef TEST
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll N;
  cin >> N;
  VL as(N);
  rep(i, N) cin >> as[i];

  VL res(3);

  mint ret = 1;

  for (auto& a : as) {
    ll ct = 0;
    ll i = -1;
    rep(j, res.size()) {
      if (res[j] == a) {
        ct++;
        i = j;
      }
    }
    if (ct == 0) {
      cout << 0 << endl;
      return 0;
    }
    res[i]++;
    ret *= ct;
  }

  cout << ret << endl;

  return 0;
}

Compiler output:
a.cc:79: error: unterminated #ifndef
   79 | #ifndef TEST
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define FORL(i,x) for(int i=head[x];i;i=nxt[i])
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define PB push_back
#define MP make_pair
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main() {
  ll n;
  cin >> n;
  ll a[n];
  ll x,y,z;
  const ll MOD = 1000000007;
  FOR(i,0,n-1) cin >> a[i];

  x = 0; y = 0; z = 0;

  ll ans = 1;

  FOR(i,0,n-1){
    if(x==a[i]) {
      ++x;
      ll num = 1;
      if(y==a[i]) ++num;
      if(z==a[i]) ++num;
      ans *= num;
      ans %= MOD;
    }
    else if(y==a[i]) {
      ++y;
      ll num = 1;
      if(z==a[i]) ++num;
      ans *= num;
      ans %= MOD;
    }
    else if(z==a[i){
      ++z;
    }
    else{
      cout << 0 << endl;
      return 0;
    }
  }

  cout << ans << endl;







  


}



Compiler output:
a.cc: In function 'int main()':
a.cc:46:19: error: expected ']' before ')' token
   46 |     else if(z==a[i){
      |                   ^
      |                   ]
Language: C++

#include <bits/stdc++.h>
//#include <atcoder/all>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;


template <class T>
inline bool chmin(T &a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;
//using namespace atcoder;

void solve(){
	ll t1,t2;
	cin>>t1>>t2;
	ll a1,a2,b1,b2;
	cin>>a1>>a2>>b1>>b2;
	if(a1*t1+a2*t2==b1*t1+b2*t2){
		cout<<"infinity\n";
	}
	else if(a[0]*t[0]>b[0]*t[0]&&a[0]*t[0]+a[1]*t[1]>b[0]*t[0]+b[1]*t[1])cout<<0<<"\n";
	else if(a[0]*t[0]<b[0]*t[0]&&a[0]*t[0]+a[1]*t[1]<b[0]*t[0]+b[1]*t[1])cout<<0<<"\n";
	else{
		ll x=abs(a1*t1+a2*t2-b1*t1-b2*t2);
		ll y=abs(a1-b1)*t1;
		ll ans=y/x*2+1;
		if(abs(a1-b1)%abs(a1*t1+a2*t2-b1*t1-b2*t2)==0)--ans;
		cout<<ans<<"\n";
	}
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:66:17: error: 'a' was not declared in this scope; did you mean 'a2'?
   66 |         else if(a[0]*t[0]>b[0]*t[0]&&a[0]*t[0]+a[1]*t[1]>b[0]*t[0]+b[1]*t[1])cout<<0<<"\n";
      |                 ^
      |                 a2
a.cc:66:22: error: 't' was not declared in this scope; did you mean 't2'?
   66 |         else if(a[0]*t[0]>b[0]*t[0]&&a[0]*t[0]+a[1]*t[1]>b[0]*t[0]+b[1]*t[1])cout<<0<<"\n";
      |                      ^
      |                      t2
a.cc:66:27: error: 'b' was not declared in this scope; did you mean 'b2'?
   66 |         else if(a[0]*t[0]>b[0]*t[0]&&a[0]*t[0]+a[1]*t[1]>b[0]*t[0]+b[1]*t[1])cout<<0<<"\n";
      |                           ^
      |                           b2
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int t[2],a[2],b[2];
    for(int i=0;i<2;i++)cin >> t[i];
    for(int i=0;i<2;i++)cin >> a[i];
    for(int i=0;i<2;i++)cin >> b[i];
    long long int move=t[0]*(a[0]-b[0])+t[1]*(a[1]-b[1]);
    long long int MAX=max(max(0LL,t[0]*(a[0]-b[0])),t[0]*(a[0]-b[0])+t[1]*(a[1]-b[1]));
    long long int MIN=min(min(0LL,t[0]*(a[0]-b[0])),t[0]*(a[0]-b[0])+t[1]*(a[1]-b[1]));
    if(move==0)cout << "infinity";
    else{
        if(MIN==0 || MAX==0)cout << 0;
        else if(move>0)cout << 2*((-MIN)/move+1) - 1;
        else cout << 2*((-MAX)/move+1) - 1;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: expected '}' at end of input
   16 |     }
      |      ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e16+7;
int mod = 1e9+7;
int dx[4] = {1,-1, 0, 0};
int dy[4] = {0, 0, 1,-1};
signed main() {
    int T1,T2,A1,A2,B1,B2;
    cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;
    if((A1 <= B1 && A2 <= B2) || (A1 >= B1 && A2 >= B2)) {
        cout << 0 << endl;
        return 0;
    }
    int X = (A1-B1)*T1;
    int Y = (A2-B2)*T2;
    if(X < 0) {
        X*=-1;Y*=-1;
    }
    if(X == -Y) {
        cout << "infinity" << endl;
    }
    // X-Y+X-Y+X-Y
    else if(X+Y > 0) {
        cout << 12121212 << endl;
    }
    else {
        // 2 3 2 3 2 3 2 3 2 3 2 3
        // 2 -1 1 -2 0 -3 -1
        cout << X/(abs(X+Y))*2+1 << endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:9:15: note: to match this '{'
    9 | signed main() {
      |               ^
Language: C++

from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580


def solve():
    T1,T2 = map(int, input().split())
    A1,A2 = map(int, input().split())
    B1,B2 = map(int, input().split())
    X1 = (A1 - B1)*T1
    X2 = (A2 - B2)*T2
    if X1 + X2 == 0:
        print("infinity")
        return
    
    P = X1
    cnt = 0
    while True:
        P1 = P + X2
        if(P1*P > 0):
            break
        cnt = cnt + 1
        P2 = P1 + X1
        if(P1*P2 > 0):
            break
        cnt = cnt + 1
        P = P2
    
    print(cnt)

    
if __name__ == '__main__':
    solve()


Compiler output:
a.cc:38:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   38 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'from' does not name a type
    1 | from sys import stdin
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl ;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;

#define rep(i,N) for(int i=0; i < (int)N; i++)
#define all(v) (v).begin(),(v).end()

const int INF = 100000002;

int main(){
	vl t(2); rep(i,2) cin >> t[i];
	vl a(2); rep(i,2) cin >> a[i];
	vl b(2); rep(i,2) cin >> b[i];
	vl da(2), db(2);
	rep(i,2) {
		da[i] = t[i] * a[i];
		db[i] = t[i] * b[i];
	}
	if(da[0]+da[1] == db[0]+db[1]){
		cout << "infinity" << endl;
		return 0;
	}
	if(da[0] > db[0] && (da[0]+da[1]) > (da[0]+db[1])){
		cout << 0 << endl;
		return 0;
	}
	if(db[0] > da[0] && (da[0]+da[1]) < (da[0]+db[1])){
		cout << 0 << endl;
		return 0;
	}
	if(db[0] > da[0]){
		swap(db[0], da[0]);
		swap(db[1], da[1]);
	}
	ll per = ((db[0] + db[1])) - (da[0] + da[1]);
	
	ll ans  = ceil((da[0]-db[0]) / (double)per) * 2 -1;
	if((da[0]-db[0]) % (double)per == 0) ans ++;
	cout << ans << endl; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:26: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'double' to binary 'operator%'
   43 |         if((da[0]-db[0]) % (double)per == 0) ans ++;
      |            ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
      |                  |         |
      |                  |         double
      |                  __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;

int main(){
  long long int t,tt,a,aa,b,bb;
  cin >> t >> tt;
  cin >> a >> aa;
  cin >> b >> bb;
  if(a+aa == b + bb){
  	cout << "Infinity" << endl; return 0;
  }
  if(a+aa < b+bb){
  	swap(a,b); swap(aa,bb);
  }
  if(a>b){cout << 0 << endl; return 0;}
  long long int d = (t*a+tt*aa) - (t*b+tt*bb);
  cout << (t*(b-a))/d << endl;
  return 0;
}
  return 0;
}


Compiler output:
a.cc:5:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    5 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include <cstdint>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <cfloat>


#include <boost/multiprecision/cpp_int.hpp>

using namespace std;

using lint=int64_t;
using uint=uint32_t;
using ulint=uint64_t;

using Bint = mp::cpp_int;

template<class T>
using vector2d=vector<vector<T>>;

template<class T>
bool UpdateMax(T &a, const T &b){
  if(a<b){
    a=b;
    return true;
  }else{
    return false;
  }
}

template<class T>
bool UpdateMin(T &a, const T &b){
  if(a>b){
    a=b;
    return true;
  }else{
    return false;
  }
}

template <class T>
void OutVec(const vector<T>& vec){
  for(int i = 0; i < vec.size() - 1; ++i){
    cout<<vec[i]<<" ";
  }
  cout<<vec.back()<<endl;
}

template <class T>
void OutVec2d(const vector2d<T>& vec){
  for(auto v:vec){
    OutVec(v);
  }
}

int main(){
  cout << std::fixed << std::setprecision(16);
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  lint t1,t2,a1,a2,b1,b2;
  cin>>t1>>t2>>a1>>a2>>b1>>b2;
  if((a1>b1)){
    swap(a1,b1);
    swap(a2,b2);
  }

  Bint top_diff=(b2-a2)*t2+(b1-a1)*t1;
  Bint first_pos=(b1-a1)*t1;

  if(top_diff==0){
    cout<<"infinity"<<endl;
    return 0;
  }
  if(top_diff<0){
    Bint min=0,max=INT64_MAX;
    Bint mid=(min+max)/2;
    while(max-min>1){
      Bint top=first_pos+top_diff*mid;
      if(top==0){
        cout<<mid*2<<endl;
        return 0;
      }else if(top>0){
        min=mid;
      }else{
        max=mid;
      }
      mid=(min+max)/2;
    }
    cout<<min*2+1<<endl;
    return 0;

  }else{
    cout<<0<<endl;
  }


  return 0;
}




Compiler output:
a.cc:20:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   20 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

///                                                     ببِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم
#include <bits/stdc++.h>
#define off  exit( 0 )
#define cn   continue
#define rt   return
#define sc   scanf
#define pr   printf
#define pb   push_back
#define pf   push_front
#define p_f  pop_front
#define p_b  pop_back
#define ff   first
#define ss   second
#define vec  vector
#define gcd  __gcd
#define pi   acos( -1 )
#define ll   long long
#define ld   long double
#define N    2256
#define M    1000000007
#define I    1000000000000000000
#define pdd  pair < ld, ld >
#define pll  pair < ll, ll >
#define pii  pair < int, int >
#define rep( a, b, c, d )  for( int a = b; a <= c; a += d )
#define rvv( a, b, c, d )  for( int a = b; a >= c; a -= d )
#define en                 printf( "\n" )
#define sqr( a )           a * a
#define all( c )           c.begin(), c.end()
#define srt( c )           sort( all( c ) )
#define rev( c )           reverse( all( c ) )
#define srtr( c )          sort( c.rbegin(), c.rend() )
#define numcounts          __builtin_popcount
#define mxn( x, y, z )     max( x, min( y, z ) )
#define mnx( x, y, z )     min( x, max( y, z ) )
const int dx[ ] = { 1, -1, 0, 0 };
const int dy[ ] = { 0, 0, -1, 1 };
using namespace std;
ll ttt = 1;
ll n, m, a, b, A, B;
void solve()
{
    cin >> n >> m >> a >> b >> A >> B;
    a *= n;
    A *= n;
    b *= m;
    B *= m;
    if(a + b == A + B)
    {
        cout << "Infinity";
        rt;
    }
    if(a + b > A + B)
    {
        swap(a, A);
        swap(b, B);
    }
    if(a < A)
    {
        cout << "0";
        rt;
    }
    k = (a - A) / (A + B - a - b);
    if(k * (A + B - a - b) == a - A)z ++;
    k ++;
    cout << 2 * k - 1 - z;
}
int main()
{
    //sc( "%I64d", &ttt );
    for(int i = 0; i < ttt; i ++ )
        solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:63:5: error: 'k' was not declared in this scope
   63 |     k = (a - A) / (A + B - a - b);
      |     ^
a.cc:64:37: error: 'z' was not declared in this scope
   64 |     if(k * (A + B - a - b) == a - A)z ++;
      |                                     ^
a.cc:66:25: error: 'z' was not declared in this scope
   66 |     cout << 2 * k - 1 - z;
      |                         ^
Language: C++

t1,t2 = map(int,input().split())
a1,a2 = map(int,input().split())
b1,b2 = map(int,input().split())

d1 = (a1-b1)*t1
d2 = (b2-a2)*t2

if d1 == d2:
    print('infinity')
 
if d1 * (d2 - d1) < 0:
    print(0)

if d1*(d2-d1)>0:
    if d1%(d1-d2)==0:
        print((d1//(d2-d1))*2)
    else:
        print((d1//(d2-d1))*2+1)

Compiler output:
a.cc:9:11: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    9 |     print('infinity')
      |           ^~~~~~~~~~
a.cc:1:1: error: 't1' does not name a type
    1 | t1,t2 = map(int,input().split())
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int ab(int a,int b){
  if(a>b) return a-b;
  else return b-a;
}
int main(){
  long T,t,A,a,B,b;
  cin>>T>>t>>A>>a>>B>>b;
  if(T*A+t*a==T*B+t*b) cout<<"infinity"<<endl;
  else{
    int V=A-B;
    int v=a-b;
    if(TV*(T*V+t*v)>0) cout<<0<<endl;
    else{
      int d=ab(T*V,t*v);
      int TV=ab(T*V,0);
      int x=TV/d;
      int X=TV%d;
      if(X==0){
        cout<<(x-2)*2+2<<endl;
      }else{
        cout<<2*x-1<<endl;
      }
    }
  }
}
      
    
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'TV' was not declared in this scope; did you mean 'V'?
   14 |     if(TV*(T*V+t*v)>0) cout<<0<<endl;
      |        ^~
      |        V
a.cc:17:11: error: redeclaration of 'int TV'
   17 |       int TV=ab(T*V,0);
      |           ^~
a.cc:14:8: note: '<typeprefixerror>TV' previously declared here
   14 |     if(TV*(T*V+t*v)>0) cout<<0<<endl;
      |        ^~
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
using namespace std;
const ll mod=1e9+7;

int main(){
    ll t1,t2,a1,a2,b1,b2,n,ans=0;
    cin>>t1>>t2>>a1>>a2>>b1>>b2;
    ll c1=a1-b1,c2=a2-b2;
    ll d1=c1*t1;
    ll d2=c2*t2;
    if(labs(d2)<labs(d1))swap(d1,d2);
    ll f=labs(d1+d2);
  
    if(f==0) cout<<"infinity";
    else if(0<=d2&&0<=d1) cout<<0;
    else if(d1<0&&d2<0)cout<<0-
    else if(labs(d2)<labs(d1))cout<<0;
    else if(labs(d1)%f==0)cout<<labs(d1)/f;
    else if(labs(d1)%f!=0)cout<<labs(d1)/f+(ll)1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: expected primary-expression before 'else'
   25 |     else if(labs(d2)<labs(d1))cout<<0;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
using namespace std;
const ll mod=1e9+7;

int main(){
    ll t1,t2,a1,a2,b1,b2,n,ans=0;
    cin>>t1>>t2>>a1>>a2>>b1>>b2;
    ll c1=a1-b1,c2=a2-b2;
    ll d1=c1*t1;
    ll d2=c2*t2;
    ll f=labs(d1-d2);
    if(d1<0)swap(d1,d2);
  
    if(d1+d2==0) cout<<"infinity";
    else if(0<=d2) cout<<0;
    else if(d2<0&&labs(d2)<d1)cout<<0;
    else if(d1%f==0)cout<<d1/f;
    else if(d1%f!=0)cout<<d1/f+(ll1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:33: error: 'll1' was not declared in this scope; did you mean 'll'?
   26 |     else if(d1%f!=0)cout<<d1/f+(ll1;
      |                                 ^~~
      |                                 ll
a.cc:26:36: error: expected ')' before ';' token
   26 |     else if(d1%f!=0)cout<<d1/f+(ll1;
      |                                ~   ^
      |                                    )
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007
int main() {
    ll t1, t2, a1, a2, b1, b2;
    cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
    //自明なケース
    if(a1 > b1 && a2 > b2) {
        cout << 0 << endl;
        return 0;
    }
    if(a1 < b1 && a2 < b2) {
        cout << 0 << endl;
        return 0;
    }
    ll c1 = (a1 - b1) * t1, c2 = (a2 - b2) * t2;
    if(abs(c1) == abs(c2)) {
        cout << "infinity" << endl;
        return 0;
    }
    if(c1 > 0 && c1 + c2 > 0) {
        cout << "infinity" << endl;
        return 0;
    }
    if(c1 < 0 && c1 + c2 < 0) {
        cout << "infinity" << endl;
        return 0;
    }
    ll itv = abs(c1 + c2);
    /*
    for(int i = 0; i < 120; i++) {
        if(i % 2 == 0) {
            cout << i / 2 * (c1 + c2) << " ";
        } else {
            cout << (i + 1) / 2 * c1 + (i - 1) / 2 * c2 << " ";
        }
    }
    cout << endl;
    */
    if(c1 % (c1 + c2) != 0) {
        cout << (abs(c1)/itv * 2 - 1 << endl;
    } else {
        cout << (abs(c1)/ itv * 2 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:38: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   43 |         cout << (abs(c1)/itv * 2 - 1 << endl;
      |                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:43:45: error: expected ')' before ';' token
   43 |         cout << (abs(c1)/itv * 2 - 1 << endl;
      |                 ~                           ^
      |                                             )
a.cc:45:35: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   45 |         cout << (abs(c1)/ itv * 2 << endl;
      |                  ~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:45:42: error: expected ')' before ';' token
   45 |         cout << (abs(c1)/ itv * 2 << endl;
      |                 ~                        ^
      |                                          )
Language: C

#include <stdio.h>

int main() {
	long t1,t2,a1,a2,b1,b2;
	long result1,result2;
	long mod;
	scanf("%ld %ld", &t1,&t2);
	scanf("%ld %ld", &a1,&a2);
	scanf("%ld %ld", &b1,&b2);
	
	result1=(a1-b1)*t1;
	result2=result1+(a2-b2)*t2;
	if(result2==0) {
		printf("infinity");
		return 0;
	}
	if(result1>0) {
		if(result2>0) {
			printf("0");
			return 0;
		} else {
			if(result1%(-result2)==0) {
				mod=0;
			} else {
				mod=1
			}
			printf("%ld", result1/(-result2)*2+mod);
		}
	} else {
		if(result2<0) {
			printf("0");
			return 0;
		} else {
			if((-result1)%(result2)==0) {
				mod=0;
			} else {
				mod=1
			}
			printf("%ld", result1/(-result2)*2+mod);
			return 0;
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:38: error: expected ';' before '}' token
   25 |                                 mod=1
      |                                      ^
      |                                      ;
   26 |                         }
      |                         ~             
main.c:37:38: error: expected ';' before '}' token
   37 |                                 mod=1
      |                                      ^
      |                                      ;
   38 |                         }
      |                         ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int T1, T2;
long long A1, A2, B1, B2, P, Q;
int main()
{
    cin >> T1 >> T2;
    cin >> A1 >> A2;
    cin >> B1 >> B2;
    P = (A1 - B1) * T1;
    Q = (A2 - B2) * T2;
    if(P < 0){
        P = -P;
        Q = -Q;
    }
    if( P + Q < 0){
        cout << 0 << endl;
    }
    else if(P + Q == 0)
    {
        cout << "infinity" << endl;
    }
    else
    {
        long long S = (-P) / (P+Q);
        long long T = (-P) % (P+Q);
        if (T!=0):
            cout << S * 2+1 << endl;
        else
            cout << S * 2 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: expected primary-expression before ':' token
   29 |         if (T!=0):
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int T1, T2;
  long long A1, A2, B1, B2;
  cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;
  
  long long a=T1*A1-T1*B1, b=T2*A2-T2*B2;
  if(a==-b && a!=0){
    cout << "infinity"<< endl;
    return 0;
  }
  int ans=0;
  if((a<0 && a+b>0) || (a>0 && a+b<0){
    ans=a/(a+b)*2;
    if(ans<0){
      ans*=-1;
    }
    if(a%(a+b)!=0) ans++;
  }
  cout << ans << endl;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:38: error: expected ';' before '{' token
   14 |   if((a<0 && a+b>0) || (a>0 && a+b<0){
      |                                      ^
      |                                      ;
a.cc:21:22: error: expected ')' before ';' token
   21 |   cout << ans << endl;
      |                      ^
      |                      )
a.cc:14:5: note: to match this '('
   14 |   if((a<0 && a+b>0) || (a>0 && a+b<0){
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll MOD=1e9+7;
const ll N=2e5+5;
const ld pi=3.14159265359;
const ll INF=(1LL<<63);
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define setp setprecision
#define lwb lower_bound
#define SZ(a) (ll)a.size()

ll n,a[N],ans=1,id,cnt,j,c[3];

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	REP(i,2)cin>>t[i];
	REP(i,2)cin>>a[i];
	REP(i,2)cin>>b[i];
	A=(a[0]-b[0])*t[0];b=(a[1]-b[1])*t[1];
	if(A>0)A*=-1,B*=-1;
	if(A+B<0)cout<<0;
	else if(A+B==0){
		cout<<"infinity\n";
	}else{
		cout<<((-A)%(A+B)==0?-A*2:-A*2+1)<<"\n";
	}
	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:24:22: error: 't' was not declared in this scope
   24 |         REP(i,2)cin>>t[i];
      |                      ^
a.cc:26:22: error: 'b' was not declared in this scope
   26 |         REP(i,2)cin>>b[i];
      |                      ^
a.cc:27:9: error: 'A' was not declared in this scope
   27 |         A=(a[0]-b[0])*t[0];b=(a[1]-b[1])*t[1];
      |         ^
a.cc:27:17: error: 'b' was not declared in this scope
   27 |         A=(a[0]-b[0])*t[0];b=(a[1]-b[1])*t[1];
      |                 ^
a.cc:27:23: error: 't' was not declared in this scope; did you mean 'tm'?
   27 |         A=(a[0]-b[0])*t[0];b=(a[1]-b[1])*t[1];
      |                       ^
      |                       tm
a.cc:28:22: error: 'B' was not declared in this scope
   28 |         if(A>0)A*=-1,B*=-1;
      |                      ^
a.cc:29:14: error: 'B' was not declared in this scope
   29 |         if(A+B<0)cout<<0;
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long  ll;
int main(){
  ll t1,t2,a1,a2,b1,b2;
  cin >> t1 >> t2;
  cin >> a1 >> a2;
  cin >> b1 >> b2;
  ll tmp;
  ll asd=0;
  if((a1-b1)*t1==(b2-a2)*t2)cout << "infinity" << endl;
  else if(a1<b1&&a2<b2) cout << 0 << endl;
  else if(b1<a1&&b2<a2) cout << 0 << endl;
  else if(b1<a1){
    //tmp = (b1*t1+b2*t2)-(a1*t1+a2*t2);
    tmp = (b1-a1)*t1+(b2-a2)*t2;
    if(((a1-b1)*t1)%tmp!=0)asd=1;
    cout << 2*(((a1-b1)*t1)/tmp)+asd << endl;
  }
  else if(a1<b1){
    //tmp = (a1*t1+a2*t2)-(b1*t1+b2*t2);
    tmp = (a1-b1)*t1+(a2-b2)*t2;
    if(((b1-a1)*t1)%tmp!=)asd=1;
    cout << 2*(-1+((b1-a1)*t1)/tmp)+asd << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: error: expected primary-expression before ')' token
   23 |     if(((b1-a1)*t1)%tmp!=)asd=1;
      |                          ^
Language: C++

T1,T2 = map(int,input().split())
A1,A2 = map(int,input().split())
B1,B2 = map(int,input().split())
T = T1 + T2
x = []
y = []
x.append(0)
y.append(0)
for i in range(1,T+1):
    x.append(A1*T1)
    x.append(A2*T2)
    y.append(B1*T1)
    y.append(B2*T2)
L = len(x)
for i in range(1,L):
    x[i] += x[i-1]
    y[i] += y[i-1]
if x[2]==y[2]:
    print("infinity")
    exit()
if x[L-1]>y[L-1]:
    x,y = y,x
ans = 0
for i in range(1,L):
    if x[i-1]>=y[i-1] and x[i] < y[i]:
        ans += 1
    if x[i-1]<y[i-1] and x[i] >= y[i]:
        ans += 1
print(ans)

Compiler output:
a.cc:1:1: error: 'T1' does not name a type
    1 | T1,T2 = map(int,input().split())
      | ^~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define sz(x) ll(x.size())
using namespace std;

const ll mo=1000000007;

int main() {
  ll ans=0,t1,t2,a1,a2,b1,b2,p,q,s,t;
  cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
  p=(a1-b1)*t1;
  q=(a2-b2)*t2;
  if(p+q<0) puts("0");
  else if(p+q==0) puts("infinity");
  else{
  	s=-p/(p+q);
  	t=-p-(p+q)*s;
  	ans+=s*2
  	if(t==0) ans++;
    cout << ans << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: expected ';' before 'if'
   19 |         ans+=s*2
      |                 ^
      |                 ;
   20 |         if(t==0) ans++;
      |         ~~
Language: C++

#include <cstdio>
#include <algorithm>

using namespace std;

int T1, T2;
long long A1, A2, B1, B2;
long long da1, da2, db1, db2, diff1, diff2, suma, sumb;
long long ans;

int main()
{
    scanf("%d%d", &T1, &T2); scanf("%lld%lld%lld%lld", &A1, &A2, &B1, &B2);
    da1 = A1 * T1; da2 = A2 * T2; db1 = B1 * T1; db2 = B2 * T2;
    diff1 = da1 - db1; diff2 = da2 - db2; suma = da1 + da2; sumb = db1 + db2;
    if (suma == sumb)
    {
        printf("infinity\n");
        return 0;
    }
    if ((diff1 < 0 && sumb > suma) || (diff1 > 0 && suma > sumb))
    {
        printf("0\n");
        return 0;
    }
    ans = abs(diff1) / abs(diff1 + diff2);
    if (abs(diff1) % abs(diff1 + diff2 != 0)
    {
        printf("%lld\n", ans * 2 + 1);
    }
    else
    {
        printf("%lld\n", ans * 2);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:45: error: expected ';' before '{' token
   27 |     if (abs(diff1) % abs(diff1 + diff2 != 0)
      |                                             ^
      |                                             ;
   28 |     {
      |     ~                                        
a.cc:31:5: error: expected primary-expression before 'else'
   31 |     else
      |     ^~~~
a.cc:30:6: error: expected ')' before 'else'
   30 |     }
      |      ^
      |      )
   31 |     else
      |     ~~~~
a.cc:27:8: note: to match this '('
   27 |     if (abs(diff1) % abs(diff1 + diff2 != 0)
      |        ^
Language: C++



#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}
int Madd(int x,int y) {return (x+y)%M;}
int Msub(int x,int y) {return (x-y+M)%M;}
int Mmul(int x,int y) {return (x*y)%M;}


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);

  int t1,t2,a1,a2,b1,b2;
  cin>>t1>>t2>>a1>>a2>>b1>>b2;
  
  int s1=t1*(a1-b1);
  int s2=t2*(a2-b2);
  if(p>0){
    p*=-1;
    q*=-1;
  }

  if(s1+s2<0){
    cout<<0<<endl;
  }else if(s1+s2==0){
    cout<<"infinity"<<endl;
  }else{
    int s=(-s1)/(s1+s2);
    int t=(-s1)%(s1+s2);
    cout<<2*s+!!t<<endl;
  }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:6: error: 'p' was not declared in this scope
   44 |   if(p>0){
      |      ^
a.cc:46:5: error: 'q' was not declared in this scope
   46 |     q*=-1;
      |     ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <tuple>

#define rep(i,n) for(ll i=0;i<n;i++)
#define dup(x,y) (((x)+(y)-1)/(y)) // dup * y >= x なる最小のdup.
using namespace std;
typedef long long ll;
using Graph = vector<vector<ll>>;
//	std::cout<<std::fixed<<std::setprecision(10);

ll gcd(ll a, ll b) {
	if(a<b){
    ll tmp = a;
    a = b;
    b = tmp;
  }
	ll r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }

	return b;
}

int main() {
	ll T1, T2, A1, A2, B1, B2;
	cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;
	string inf = "infinity";

	ll dist[2] = {T1*(A1-B1), T2*(A2-B2)};
	if(dist[0]>0) {
		dist[0] *= -1;
		dist[1] *= -1;
	}

	if(dist[0]+dist[1]==0) {
		cout << inf << endl;
	} else if(dist[0]+dist[1]<0) {
		cout << 0 << endl;
	}else {
		ll ans = 2*(-dist[0]/(dist[0]+dist[1]))+1;
		if(abs(dT[0])%abs(dT[1]+dT[0])==0) ans--;
		cout << ans << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:24: error: 'dT' was not declared in this scope
   53 |                 if(abs(dT[0])%abs(dT[1]+dT[0])==0) ans--;
      |                        ^~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define co(ans) cout<<ans<<endl;
#define COYE cout<<"YES"<<endl;
#define COYe cout<<"Yes"<<endl;
#define COye cout<<"yes"<<endl;
#define CONO cout<<"NO"<<endl;
#define CONo cout<<"No"<<endl;
#define COno cout<<"no"<<endl;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
using namespace std;


int main(){
  ll T,TT,A,AA,B,BB,ans=0;
  cin>>T>>TT>>A>>AA>>B>>BB;
  
  //常にA<Bとなるようにする
  if(A>B){
    ll W=A;
    A=B;
    B=W;
    W=AA;
    AA=BB;
    BB=W;
  }
  
  ll L=(B-A)*T;
  ll LL=(BB-AA)*TT;
  
  
  if(L+LL==0){
    cout<<"infinity"<<endl;
    return 0;
  }
  
  if(L+LL>0){
    cout<<0<<endl;
    return 0;
  }
  
  if(L%(L-LL)==0){
    ans=2*(L-/(L-LL));
  }
  else ans=2*(L-/(L-LL))+1;
  
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:14: error: expected primary-expression before '/' token
   60 |     ans=2*(L-/(L-LL));
      |              ^
a.cc:62:17: error: expected primary-expression before '/' token
   62 |   else ans=2*(L-/(L-LL))+1;
      |                 ^
Language: C++

#include<iostream>
#include<string>
#include<math.h>
using namespace std;

int main(){

  long long T1,T2;
  long long A1,A2;
  long long B1,B2;
  cin >> T1 >> T2;
  cin >> A1 >> A2;
  cin >> B1 >> B2;

  long long A1dis,A2dis,B1dis,B2dis;
  A1dis = A1 * T1;
  A2dis = A2 * T2;
  B1dis = B1 * T1;
  B2dis = B2 * T2;
  
  long long AB1dis,AB2dis;
  AB1dis = A1dis - B1dis;
  AB2dis = A2dis - B2dis;
  if(AB1dis >= 0 && AB2dis >= 0){
    cout << 0;
    return 0;
  }
  if(AB1dis <= 0 && AB2dis <= 0){
    cout << 0;
    return 0;
  }
  if(AB1dis + AB2dis == 0){
    cout << "infinity";
    return 0;
  }
  long long AB1disAbs,AB2disAbs;
  AB1disAbs = llabs(AB1dis);
  AB2disAbs = llabs(AB2dis);
  long long dif;
  dif = labs(AB1disAbs - AB2disAbs);
  long long cnt;
  if((AB1disAbs % dif) == 0){
    cnt = (floor(AB1disAbs / dif) * 2) + 1;
  else{
    cnt = floor(AB1disAbs / dif) * 2;
  }
  cout << cnt;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:3: error: expected '}' before 'else'
   44 |   else{
      |   ^~~~
a.cc:42:29: note: to match this '{'
   42 |   if((AB1disAbs % dif) == 0){
      |                             ^
Language: C++

#include<iostream>
#include<string>
#include<math.h>
using namespace std;

int main(){

  long long T1,T2;
  long long A1,A2;
  long long B1,B2;
  cin >> T1 >> T2;
  cin >> A1 >> A2;
  cin >> B1 >> B2;

  long long A1dis,A2dis,B1dis,B2dis;
  A1dis = A1 * T1;
  A2dis = A2 * T2;
  B1dis = B1 * T1;
  B2dis = B2 * T2;
  
  long long AB1dis,AB2dis;
  AB1dis = A1dis - B1dis;
  AB2dis = A2dis - B2dis;
  if(AB1dis >= 0 && AB2dis >= 0){
    cout << 0;
    return 0;
  }
  if(AB1dis <= 0 && AB2dis <= 0){
    cout << 0;
    return 0;
  }
  if(AB1dis + AB2dis == 0){
    cout << "infinity";
    return 0;
  }
  long long AB1disAbs,AB2disAbs;
  AB1disAbs = llabs(AB1dis);
  AB2disAbs = llabs(AB2dis);
  long long dif;
  dif = labs(AB1disAbs - AB2disAbs);
  long long cnt;
  if(AB1disAbs % dif) == 0){
    cnt = (floor(AB1disAbs / dif) * 2) + 1;
  else{
    cnt = floor(AB1disAbs / dif) * 2;
  }
  cout << cnt ;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:23: error: expected primary-expression before '==' token
   42 |   if(AB1disAbs % dif) == 0){
      |                       ^~
a.cc:49:2: error: expected '}' at end of input
   49 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<iostream>

using namespace std;


int main()
{
	long long t1,t2,a1,a2,b1,b2;
	cin >> t1>>t2>>a1>>a2>>b1>>b2;
	
	if (a1 == b1)cout << "infinity" << endl;
	else if(a1>=b1&&a2>=b2)cout << 0 << endl;
	else if(a1<=b1&&a2<=b2)cout << 0 << endl;
	else {
		long long x = (a1 - b1)*t1;
		long long y = (a2 - b2)*t2;
		long long z = x + y;
		if (z == 0)cout << "infinity" << endl;
		if (z > 0) {
			if (x < 0)cout << (x*(-1)) / z << endl;
			else if (y < 0) cout << (y*(-1)) / z << endl;
		}
		if (z < 0) {
			if (x >0)cout << x / (z*(-1)) << endl;
			else if (y > 0) cout << y / (z*(-1)) << endl;
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^