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

#define _GLIBCXX_DEBUG//TLEの原因になるので注意！！！！！！！！！！！
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.xise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
deque<int> deq;
//#define int long long

//cerrはコメントアウトしなくても通る//ただしTLEを引き起こすことがある

int main(){
    int t1,t2;
    int a1,a2;
    int b1,b2;
    cin >> t1>>t2>>a1>>a2>>b1>>b2;
    if((a1-b1)*t1==-(a2-b2)*t2){
        cout<<"infinity"<<endl;
    }else if((a1-b1)*t1+(a2-b2)*t2>0){
        cout<<0<<endl;
    }else{
        int ans=abs((a1-b1)*t1)/abs((a1-b1)*t1+(a2-b2)*t2));
        cout<<ans<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:59: error: expected ',' or ';' before ')' token
   39 |         int ans=abs((a1-b1)*t1)/abs((a1-b1)*t1+(a2-b2)*t2));
      |                                                           ^
Language: C++

#include <iostream>
#include <cmath>
#include <cstdlib>

int main(void){
    unsigned long long T[2];
    std::cin >> T[0] >> T[1];
    unsigned long long A[2], B[2];
    std::cin >> A[0] >> A[1] >> B[0] >> B[1];

    unsigned long long diffAtoB[2];
    for(int i = 0; i < 2; ++i) diffAtoB[i] = (B[i] - A[i]) * T[i];
    if(diffAtoB[0] + diffAtoB[1] == 0) {
        std::cout << "infinity\n";
        return 0;
    }

    // AからみたBの距離
    unsigned long long diff_before = 0;
    unsigned long long diff_curr = 0;
    int i = 0;
    unsigned long ct = 0;
    while(ct > -){
        diff_curr = diffAtoB[i];
        if(diff_before != 0){
            if(diff_before < 0 && diff_curr > 0){
                if(diff_curr + diff_before > 0){
                    ++ct;
                }
            }
            else if(diff_before > 0 && diff_curr < 0){
                if(diff_curr + diff_before < 0){
                    ++ct;
                }
            }
        }
        diff_before += diff_curr;
        i ^= 1;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: expected primary-expression before ')' token
   23 |     while(ct > -){
      |                 ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define debug2(x, y)                       \
  cerr << "(" << #x << "," << #y << ") = " \
       << "(" << x << "," << y << ")\n"
#define all(x) x.begin(), x.end()
#define each(a, x) for (auto& a : (x))
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define int long long
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MX = 1e5 + 5, INF = 5LL << 57, MOD = 1e9 + 7;

int N, M;
string S;
vi va, vb;
int t1, t2, a1, a2, b1, b2;
void input() {
  cin >> t1 >> t2;
  cin >> a1 >> a2;
  cin >> b1 >> b2;
  ;
  ;
}
void solve() {
  int d11, d12, d21, d22;
  d11 = a1 * t1;
  d12 = a2 * t2;
  d21 = b1 * t1;
  d22 = b2 * t2;

  int d1, d2;
  d1 = d11 + d12;
  d2 = d21 + d22;

  debug2(d1, d2);
  if (d1 == d2) {
    cout << "infinity" << endl;
  }

  if (d11 < d21 && d1 > d2) {
    if (d1 + d11 - (d2 + d21) > 0) {
      cout << 1 << endl;
      return;
      else {
        cout << (d1 + d11 - d2 - d21) / (t1 + t2) << endl;
      }
    }
  }
  if (d21 > d11 && d2 > d1) {
  }
}
signed main() {
  input();
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:51:7: error: expected '}' before 'else'
   51 |       else {
      |       ^~~~
a.cc:48:36: note: to match this '{'
   48 |     if (d1 + d11 - (d2 + d21) > 0) {
      |                                    ^
a.cc: At global scope:
a.cc:56:3: error: expected unqualified-id before 'if'
   56 |   if (d21 > d11 && d2 > d1) {
      |   ^~
a.cc:58:1: error: expected declaration before '}' token
   58 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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; }

ll d1,d2;
void solve(ll l,ll r){
    ll m=(l+r)/2;
    if(l>r) return;
    if(m(d1-d2)+d2>0){
        chmax(ans,m);
        solve(m+1,r);
    }else{
        solve(l,m-1);
    }
}


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

    ll t1,t2,a1,a2,b1,b2;
    cin>>t1>>t2>>a1>>a2>>b1>>b2;
    ll loopa=t1*a1+t2*a2,loopb=t1*b1+t2*b2;
    if(loopa==loopb){
        cout<<"infinity"<<endl;
        return 0;
    }

    ll A1=t1*a1,A2=t2*a2,B1=t1*b1,B2=t2*b2;
    // cout<<A1<<' '<<A2<<' '<<loopa<<endl;
    // cout<<B1<<' '<<B2<<' '<<loopb<<endl;

    d1=A1-B1,d2=A2-B2;
    if( (d1>0&&d2>0) or (d1<0&&d2<0) or (d1==0&&d2!=0) or (d1!=0&&d2==0) or (abs(d1)>abs(d2)) ){

        cout<<0<<endl;
        return 0;
    }
    solve(0,LINF);
    cout<<2*ans-1<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'void solve(ll, ll)':
a.cc:20:9: error: 'm' cannot be used as a function
   20 |     if(m(d1-d2)+d2>0){
      |        ~^~~~~~~
a.cc:21:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |         chmax(ans,m);
      |               ^~~
      |               abs
a.cc: In function 'int main()':
a.cc:52:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |     cout<<2*ans-1<<endl;
      |             ^~~
      |             abs
Language: C++

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

int main()
{
	ll t1,t2,a1,a2,b1,b2;
	cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
	if (a1*t1 + a2*t2 == b1*t1 + b2*t2)
	{
		cout << "infinity" << endl;
		return 0;
	}

	if (a1 < b1)
	{
		swap(a1,b1);
		swap(a2,b2);
	}

	if (a1*t1 + a2*t2 > b1*t1 + b2*t2)
	{
		cout << "0" << endl;
	}
	else
	{
		ll diff = (b1*t1 + b2*t2) - (a1*t1 + a2*t2);
		ll ans = 1 + (a1*t1 - b1*t1) / diff * 2
		if ((a1*t1 - b1*t1) %  diff == 0) ans--;
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: expected ',' or ';' before 'if'
   31 |                 if ((a1*t1 - b1*t1) %  diff == 0) ans--;
      |                 ^~
Language: C++

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

long long absolute(long long x){
    if(x >= 0){
        return(x);
    }else{
        return(-x);
    }
}

int main(){
    long long T1,T2;
    long long A1,A2;
    long long B1,B2;
    long long cnt = 0;
    long long dist = 0,prevdist=0;
    long long tmp=0;


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

    //cout << absolute(A1*T1-B1*T1) << "" << absolute(A2*T2-B2*T2) << endl;

    if( absolute(A1*T1-B1*T1) == absolute(A2*T2-B2*T2) ){
        cout << "infinity" << endl;
        return(0);
    }else{
        while(absolute(dist) < absolute(A1*T1-B1*T1)  || absolute(dist) < absolute(A2*T2 - B2*T2)){
            if(tmp % 2 == 0){
                cout << A1*T1-B1*T1 << endl;
                dist = A1*T1-B1*T1;
            }else{
                cout << A2*T2-B2*T2 << endl;
                dist = A2*T2-B2*T2;
            }

            cout << "dist:" << dist << " prevdist" << prevdist << endl;
            cout << "dist* prevdist " << dist * prevdist << endl;

            if( (dist<0 && prevdist > 0) (dist > 0 && prevdist < 0)   ){
                cnt++;
            }

            prevdist = dist;
            tmp++;
        }
        cout << cnt << endl;
    }

    return(0);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:42: error: expression cannot be used as a function
   44 |             if( (dist<0 && prevdist > 0) (dist > 0 && prevdist < 0)   ){
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

//#include "debug.h"
#include <string.h>
#include <limits.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;

#define MAXN 30000

long long t1, t2, a1, a2, b1, b2, a, b;

int input() {
        if (scanf("%lld %lld %lld %lld %lld %lld", &t1, &t2, &a1, &a2, &b1, &b2) < 0) return 0;
        return 1;
}

void init() {
}

long long solve() {
        long long a = a1*t1 - b1*t1;
        long long b = a2*t2 - b2*t2;
        if (a<0) {
                a = -a;
                b = -b;
        }
        //a>=0
        if (a==0) return -1;
        //a>0
        //check a+b
        if (a+b==0) return -1;
        if (a+b>0) return 0;
        //a+b<0
        long long d = -(a+b);
        //printf("a=%lld d=%lld\n", a, d);
        return (a/d+1L)*2L-1;
}

void output(long long ans) {
        if (ans<0) printf("infinity\n");
        else printf("%lld\n", ans);
}

void cleanup() {
}

int main() {
        //int ca; scanf("%d", &ca);
        while (input()) {
                init();
                output(solve());
                cleanup();
                break;
        }
}


Compiler output:
a.cc: In function 'int input()':
a.cc:15:13: error: 'scanf' was not declared in this scope
   15 |         if (scanf("%lld %lld %lld %lld %lld %lld", &t1, &t2, &a1, &a2, &b1, &b2) < 0) return 0;
      |             ^~~~~
a.cc: In function 'void output(long long int)':
a.cc:42:20: error: 'printf' was not declared in this scope
   42 |         if (ans<0) printf("infinity\n");
      |                    ^~~~~~
a.cc:8:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    7 | #include <algorithm>
  +++ |+#include <cstdio>
    8 | using namespace std;
a.cc:43:14: error: 'printf' was not declared in this scope
   43 |         else printf("%lld\n", ans);
      |              ^~~~~~
a.cc:43:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define INF 999999999
#define ll long long
using namespace std;

int main(){
  ll t1,t2,a1,a2,b1,b2;
  ll count1,count2;
  cin >> t1 >> t2;
  cin >> a1 >> a2;
  cin >> b1 >> b2;
  ll d1 = t1*(a1-b1);
  ll d2 = t2*(a2-b2);
  ll d = d1+d2;
  if(d == 0){
    cout << "infinity";
    return 0;
  }
  if(-d1>0){
    if(d > 0) count1 += (-d1)/d;
  }
  if(-d1<0){
    if(d < 0) count1 += d1 / (-d);
  }
  if(-d2 > 0){
    if(0 < -d1){
      if(d > 0){
        count2 += (-(d1+d2)) / d - (-d1-1)/d;
      }
    }
    else if(0 < -(d1+d2)){
      if(d > 0){
        count2 += (-(d1+d2)+1) / d ;
      }
      else{
        count2 += (d1+1) / (-d);
      }
    }
    else{
      if(d < 0){
        count2 += ((d1+d2)) / (-d) - (d1-1)/(-d);
      }
    }
  }
  if(-d2 < 0){
    if(0 < (-d1-d2)){
      if(d > 0){
        count2 += (-(d1)) / d - (-d1-d2-1)/d;
      }
    }
    else if(0 < -d1){
      if(d > 0){
        count2 += (-(d1+1) / d ;
      }
      else{
        count2 += (d1+d2+1) / (-d);
      }
    }
    else{
      if(d < 0){
        count2 += ((d1)) / (-d) - (d1+d2-1)/(-d);
      }
    }
  }
  
    cout << count1+count2;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:31: error: expected ')' before ';' token
   56 |         count2 += (-(d1+1) / d ;
      |                   ~           ^~
      |                               )
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 t_gcd = gcd(T1, T2);
	ll ab_gcd = gcd(A1-B1, A2-B2);

	ll dT[2] = {T1*(A1-B1), T2*(A2-B2)};

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

	return 0;
}

Compiler output:
a.cc:56:9: error: expected unqualified-id before 'return'
   56 |         return 0;
      |         ^~~~~~
a.cc:57:1: error: expected declaration before '}' token
   57 | }
      | ^
Language: C++

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

int main(){
  int i,j;ll cnt=0;
  ll t1,t2,a1,a2,b1,b2;
  cin>>t1>>t2;
  cin>>a1>>a2;
  cin>>b1>>b2;
  if(t1*a1+t2*a2==t1*b1+t2*b2){
    cout<<"infinity"<<endl;
    return 0;
  }
  if((b1>a1 && a2>b2 && t1*(b1-a1)<=t2*(a2-b2)) || (b1<a1 && a2<b2 && t1*(b1-a1)>=t2*(a2-b2))){ 
    double x=((double)t2/(double)t1)*((double)(a2-b2)/(double)(b1-a1));
    cnt=(ll)floor(1/(x-1));
  }
  if(x>=0)cout<<2*cnt+1;
  else cout<<2*cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:6: error: 'x' was not declared in this scope
   19 |   if(x>=0)cout<<2*cnt+1;
      |      ^
Language: C++

import sys
sys.setrecursionlimit(4100000)
import math


T0, T1 = map(int,input().split())
A0, A1 = map(int,input().split())
B0, B1 = map(int,input().split())

delta0 = (A0 - B0) * T0
delta1 = (A1 - B1) * T1

if (delta0 * delta1 > 0) :
	print(0)
	sys.exit()
	
elif (delta0 == 0): 
	print("infinity")
	sys.exit()
	
elif (delta0 + delta1 == 0) :
	print("infinity")
	sys.exit()
	
else :

	tikuseki = 0

	# Aのほうがトータルでは速い
	if (delta0 + delta1 > 0) :

		# Aがリード　ー＞　近づく、、、、
		if (delta0 > 0) :
				
			print(0)
			sys.exit()

			
		else :

			#for (ll i = 1 i < LLINF i++) 
			#	tikuseki += delta0 + delta1
			#	if (tikuseki > -delta0) 
			#		cout << i
			#		sys.exit()
			#	
			#


			print(math.floor((math.floor(- delta0) / ((delta0 + delta1)))  + 1))
			
		

	else :

		if (delta0 < 0) :

			print(0)
			sys.exit()

			
		else :

			#for (ll i = 1 i < LLINF i++) 
			#	tikuseki += -(delta0 + delta1)
			#	if (tikuseki > delta0) 
			#		cout << i 
			#		sys.exit()
			#	
			#

			print(math.floor(delta0 / (-(delta0 + delta1)))  + 1)


			






Compiler output:
a.cc:29:11: error: invalid preprocessing directive #A\U0000306e\U0000307b\U00003046\U0000304c\U000030c8\U000030fc\U000030bf\U000030eb\U00003067\U0000306f\U0000901f\U00003044
   29 |         # Aのほうがトータルでは速い
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:32:19: error: extended character 　 is not valid in an identifier
   32 |                 # Aがリード　ー＞　近づく、、、、
      |                   ^
a.cc:32:19: error: extended character 　 is not valid in an identifier
a.cc:32:19: error: extended character 、 is not valid in an identifier
a.cc:32:19: error: extended character 、 is not valid in an identifier
a.cc:32:19: error: extended character 、 is not valid in an identifier
a.cc:32:19: error: extended character 、 is not valid in an identifier
a.cc:32:19: error: invalid preprocessing directive #A\U0000304c\U000030ea\U000030fc\U000030c9\U00003000\U000030fc\U0000ff1e\U00003000\U00008fd1\U00003065\U0000304f\U00003001\U00003001\U00003001\U00003001
   32 |                 # Aがリード　ー＞　近づく、、、、
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:41:26: error: invalid preprocessing directive #for
   41 |                         #for (ll i = 1 i < LLINF i++)
      |                          ^~~
a.cc:42:33: error: invalid preprocessing directive #tikuseki
   42 |                         #       tikuseki += delta0 + delta1
      |                                 ^~~~~~~~
a.cc:66: error: unterminated #if
   66 |                         #       if (tikuseki > delta0)
a.cc:43: error: unterminated #if
   43 |                         #       if (tikuseki > -delta0)
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll __int128
void gi(ll&x){
	x=0;char e=getchar();
	for (;e<'0'||e>'9';e=getchar());
	for (;e>='0'&&e<='9';e=getchar()) x=x*10+e-'0';
}
void print(ll x){
	if (x>9) print(x/10);
	putchar(x%10+'0');
}
int main (){
	ll t1,t2,a1,a2,b1,b2;
	gi(t1),gi(t2),gi(a1),gi(a2),gi(b1),gi(b2);
	if (a1>b1) swap(a1,b1),swap(a2,b2);
	if (a2<b2) {puts("0");return 0;}
	ll l1=a1*t1+a2*t2,l2=b1*t1+b2*t2;
	if (l1==l2) {puts("infinity");return 0;}
	ll d1=t1*b1-t1*a1,d2=t2*a2-t2*b2,dt=l1-l2;
	printf ("%lld",print(d1/dt*2ll+1));
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: invalid use of void expression
   21 |         printf ("%lld",print(d1/dt*2ll+1));
      |                        ~~~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;


int main() {
    int64_t T1, T2, A1, A2, B1, B2;
    cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;
    if (T1 * A1 + T2 * A2 == T1 * B1 + T2 * B2) {
        cout << "infinity" << endl;
        return 0;
    }
    if (A1 > B1 && A2 > B2) {
        cout << 01 << endl;
        return 0;
    }
    if (A1 < B1 && A2 < B2) {
        cout << 02 << endl;
        return 0;
    }
    if (A1 < B1) {
        int64_t a = B1, b = B2;
        B1 = A1;
        A1 = a;
        B2 = A2;
        A2 = b;
    }
    // A1 > B1 && A2 < B2 が確定
    int64_t res1 = (A1 - B1) * T1, res2 = (B2 - A2) * T2;
    if (res1 > res2) {
        cout << 0 << endl;
        return 0;
    }
    int64_t sa = res2 - res1;
    int64_t ans = (res1 / sa + 1) * 2 - 1;
    if (res % sa == 0) {
        ans++;
    }
    cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:9: error: 'res' was not declared in this scope; did you mean 'res2'?
   39 |     if (res % sa == 0) {
      |         ^~~
      |         res2
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <unordered_set>
#include <set>
using namespace std;

typedef long long ll;

int main() {
	int T1,T2;
	ll A1,A2;
	ll B1,B2;

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

	ll C1,C2;
	C1 = A1*T1-B1*T1;
	C2 = A2*T2-B2*T2;
	
	ll K = C1+C2;

	if (K == 0)
	{
		cout<<"infinity"<<endl;
		return 0;
	}

	if (K < 0)
	{
		K = -K;
		C1 = -C1;
		C2 = -C2;
		swap(A1, B1);
		swap(A2, B2);
	}

	ll S1,S2;
	S1 = 0;
	S2 = C1;

	ll D1, D2;
	D1 = 0;
	D2 = 0;

	if (C1 > 0)
	{		
		D1 = 0;
	}
	else
	{
		D1 += -C1 / K;
	}

	if (C2 > 0)
	{
		if(S2 > 0)D2 = 0;
		else
		{
			ll e = max<ll>(0, ceil(1. * (-S2-C2) / K));
			S2 += K * e;

			D2 += ceil(1. * -S2 / K);
		}
	}
	else
	{
		if (S2 < 0)
		{
			ll e = ceil(1. * -S2 / K);
			S2 += K * e;

			D2 += max<ll>(0ll, ceil(1. * (-C2 - S2) / K));
		}
		else
		{
			D2 += max<ll>(0ll, ceil(1. * (-C2-S2) / K));
		}
	}

	cout<<D1+D2<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:43: error: 'ceil' was not declared in this scope
   61 |                         ll e = max<ll>(0, ceil(1. * (-S2-C2) / K));
      |                                           ^~~~
a.cc:71:32: error: 'ceil' was not declared in this scope
   71 |                         ll e = ceil(1. * -S2 / K);
      |                                ^~~~
a.cc:78:44: error: 'ceil' was not declared in this scope
   78 |                         D2 += max<ll>(0ll, ceil(1. * (-C2-S2) / K));
      |                                            ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);    
    long long t1,t2,a1,a2,b1,b2;
    cin>>t1>>t2>>a1>>a2>>b1>>b2;
    if((a1-b1)*t1+(a2-b2)*t2==0){
        cout<<"infinity";
        return 0;
    }
    if(a1<b1){
        long long tmp;
        tmp=a1;
        a1=b1;
        b1=tmp;
         tmp=a2;
        a2=b2;
        b2=tmp;
    }
    if((a1-b1)*t1+(a2-b2)*t2>0){
        cout<<0;
        return 0;
    }
    long long p=(a1-b1)*t1;
    long long m=(a2-b2)*t2;

    long long ans=-1;
    long long x=0;
    while(1){
        x+=p;
        if(x>0){
            ans++;
        }
        if(x==0){
            ans++;
            cout <<ans;
            return 0;
        }
        if(x<0){
            cout<<ans;
            return 0;
        }
        x+=m;
        ans++;
        }
    }
    //long long ans=1-2*((a1-b1)*t1-1)/((a1-b1)*t1+(a2-b2)*t2);
}

Compiler output:
a.cc:64:1: error: expected declaration before '}' token
   64 | }
      | ^
Language: C++

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

int main()
{
  long tone,ttwo,aone,atwo,bone,btwo,ans,vone,vtwo;
  cin>>tone>>ttwo>>aone>>atwo>>bone>>btwo;
  vone=aone-bone;
  vtwo=atwo-btwo;
  if(vone*tone+vtwo*ttwo==0)cout<<"infinity";
  else if(vone*vtwo>=0)cout<<<<endl;
  else{
    ans=vone*tone*2/(vone*tone+vtwo*ttwo);
    ans=max(ans,-1*ans);
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: expected primary-expression before '<<' token
   11 |   else if(vone*vtwo>=0)cout<<<<endl;
      |                              ^~
Language: C++

#include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <limits.h>
#include <string>
#include <deque>
#include <cmath>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define mpa make_pair
#define all(a) (a).begin(), (a).end()

ll sign(ll x) {
	return  x / abs(x);
}

int main() {
	ll t1, t2, a1, a2, b1, b2;
	cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
	ll a = a1 - b1, b = a2 - b2;
	if (a * t1 + b * t2 == 0) {
		cout << "infinity" << endl;
		return 0;
	}
	cout << sign(t1*a)*sign(t1*a + t2 * b) << endl;
	if (sign(t1*a)*sign(t1*a + t2 * b) > 0) {
		cout << 0 << endl;
	}
	else {
		ll ans = 0;
		if (abs(t1*a) % abs(t1*a + t2 * b)) {
			ans = 1;
		}
		ans += abs(t1*a) / abs(t1*a + t2 * b) * 2;
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
 
#define ff first
#define ss second
#define mp make_pair
 
using namespace std;
 
typedef long long ll;

int main() {
	ll t0, t1, a0, a1, b0, b1;
 
	scanf("%lld%lld%lld%lld%lld%lld", &t0, &t1, &a0, &a1, &b0, &b1);
	
	ll curA0 = a0*t0, curA1 = a1*t1;
	ll curB0 = b0*t0, curB1 = b1*t1;
	ll d0 = curA0 - curB0;
	ll d1 = curA1 - curB1;
	ll diff = abs(d0+d1);

	if(diff == 0) {
		printf("infinity\n");
		return 0;
	}

	if((d0 >= 0 && d1 >= 0) or (d0 <= 0 && d1 <= 0)) {
		printf("0\n");
		return 0;
	}

	d0 = abs(d0); d1 = abs(d1);
	ll minn = min(d0,d1);

	printf("%lld\n", 2*(minn/diff)+(mimn%diff != 0));

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:41: error: 'mimn' was not declared in this scope; did you mean 'minn'?
   35 |         printf("%lld\n", 2*(minn/diff)+(mimn%diff != 0));
      |                                         ^~~~
      |                                         minn
Language: C++

#include <bits/stdc++.h>
 
#define ff first
#define ss second
#define mp make_pair
 
using namespace std;
 
typedef long long ll;

int main() {
	ll t0, t1, a0, a1, b0, b1;
 
	scanf("%lld%lld%lld%lld%lld%lld", &t0, &t1, &a0, &a1, &b0, &b1);
	
	ll curA0 = a0*t0, curA1 = a1*t1;
	ll curB0 = b0*t0, curB1 = b1*t1;
	ll d0 = curA0 - curB0;
	ll d1 = curA1 - curB1;
	ll diff = abs(d0+d1);

	if(diff == 0) {
		printf("infinity\n");
		return 0;
	}

	if((d0 >= 0 && d1 >= 0) or (d0 <= 0 && d1 <= 0)) {
		printf("0\n");
		return 0;
	}

	d0 = abs(d0); d1 = abs(d1);
	ll minn = min(d0,d1);

	printf("%lld\n", 2*(minn/diff)+(min%diff != 0));

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:44: error: invalid operands of types '<unresolved overloaded function type>' and 'll' {aka 'long long int'} to binary 'operator%'
   35 |         printf("%lld\n", 2*(minn/diff)+(min%diff != 0));
      |                                         ~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long t1,t2,a1,a2,b1,b2;
  cin>>t1>>t2;
  cin>>a1>>a2;
  cin>>b1>>b2;
  long long tkhs=t1*a1+t2*a2;
  long long aok=t1*b1+t2*b2;
  if(tkhs==aok){
    cout<<"infinity"<<endl;
  }else{
    

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

#include <iostream>
using namespace std;
 
int main(){
    //入力を受け取る
    int S;
    cin >> S;

  if (S == "SUN") {
    cout << 7 << endl;
  }
  else if (S == "MON") {
    cout << 6 << endl;
  }
  else if (S == "TUE") {
    cout << 5 << endl;
  }
  else if (S == "WED") {
    cout << 4 << endl;
  }
  else if (S == "THU") {
    cout << 3 << endl;
  }
  else if (S == "FRI") {
    cout << 2 << endl;
  }
  else if (S == "SAT") {
    cout << 1 << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if (S == "SUN") {
      |       ~~^~~~~~~~
a.cc:12:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   else if (S == "MON") {
      |            ~~^~~~~~~~
a.cc:15:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |   else if (S == "TUE") {
      |            ~~^~~~~~~~
a.cc:18:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |   else if (S == "WED") {
      |            ~~^~~~~~~~
a.cc:21:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |   else if (S == "THU") {
      |            ~~^~~~~~~~
a.cc:24:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |   else if (S == "FRI") {
      |            ~~^~~~~~~~
a.cc:27:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |   else if (S == "SAT") {
      |            ~~^~~~~~~~
Language: C++

#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;



int main(){
    string S;
    cin >> S;

    ll ans = 0;
    switch(S){
        case "SUN":
            ans++;
        case "MON":
            ans++;
        case "TUE":
            ans++;
        case "WED":
            ans++;
        case "THU":
            ans++;
        case "FRI":
            ans++;
        case "SAT":
            ans++;
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:12: error: switch quantity not an integer
   31 |     switch(S){
      |            ^
Language: C

#include <stdio.h>

int main(void){

  char a, b, c;
  
  scanf("%c%c%c",a,b,c); 
  
  if(abc == "SUN") printf("7");
  if(abc == "MON") printf("6");
  if(abc == "TUE") printf("5");
  if(abc == "WED") printf("4");
  if(abc == "THU") printf("3");
  if(abc == "FRI") printf("2");
  if(abc == "SAT") printf("1");
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:6: error: 'abc' undeclared (first use in this function)
    9 |   if(abc == "SUN") printf("7");
      |      ^~~
main.c:9:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){

  char S[3]:
  
  scanf("s",S);
  
  if(S = SUN) printf("7");
  if(S = MON) printf("6");
  if(S = TUE) printf("5");
  if(S = WED) printf("4");
  if(S = THU) printf("3");
  if(S = FRI) printf("2");
  if(S = SAT) printf("1");
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    5 |   char S[3]:
      |            ^
main.c:5:12: error: expected expression before ':' token
main.c:9:6: error: 'S' undeclared (first use in this function)
    9 |   if(S = SUN) printf("7");
      |      ^
main.c:9:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:10: error: 'SUN' undeclared (first use in this function)
    9 |   if(S = SUN) printf("7");
      |          ^~~
main.c:10:10: error: 'MON' undeclared (first use in this function)
   10 |   if(S = MON) printf("6");
      |          ^~~
main.c:11:10: error: 'TUE' undeclared (first use in this function)
   11 |   if(S = TUE) printf("5");
      |          ^~~
main.c:12:10: error: 'WED' undeclared (first use in this function)
   12 |   if(S = WED) printf("4");
      |          ^~~
main.c:13:10: error: 'THU' undeclared (first use in this function)
   13 |   if(S = THU) printf("3");
      |          ^~~
main.c:14:10: error: 'FRI' undeclared (first use in this function)
   14 |   if(S = FRI) printf("2");
      |          ^~~
main.c:15:10: error: 'SAT' undeclared (first use in this function)
   15 |   if(S = SAT) printf("1");
      |          ^~~
Language: C

#include <stdio.h>

int main(Void){

  char S[4];
  
  scanf("%s",S);
  
  if(S = SUN) printf("7");
  if(S = MON) printf("6");
  if(S = TUE) printf("5");
  if(S = WED) printf("4");
  if(S = THU) printf("3");
  if(S = FRI) printf("2");
  if(S = SAT) printf("1");

  return 0;
  
}

Compiler output:
main.c: In function 'main':
main.c:3:5: error: type of 'Void' defaults to 'int' [-Wimplicit-int]
    3 | int main(Void){
      |     ^~~~
main.c:9:10: error: 'SUN' undeclared (first use in this function)
    9 |   if(S = SUN) printf("7");
      |          ^~~
main.c:9:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:10: error: 'MON' undeclared (first use in this function)
   10 |   if(S = MON) printf("6");
      |          ^~~
main.c:11:10: error: 'TUE' undeclared (first use in this function)
   11 |   if(S = TUE) printf("5");
      |          ^~~
main.c:12:10: error: 'WED' undeclared (first use in this function)
   12 |   if(S = WED) printf("4");
      |          ^~~
main.c:13:10: error: 'THU' undeclared (first use in this function)
   13 |   if(S = THU) printf("3");
      |          ^~~
main.c:14:10: error: 'FRI' undeclared (first use in this function)
   14 |   if(S = FRI) printf("2");
      |          ^~~
main.c:15:10: error: 'SAT' undeclared (first use in this function)
   15 |   if(S = SAT) printf("1");
      |          ^~~
Language: C++

#include <iostream>
using namespace std;
int main(){
	String s;
  	cin >> s;
  	
  	int ans;
  	if(s == "SUN") ans =7;
  else if(s == "MON") ans =6;
  else if(s == "TUE") ans =5;
  else if(s == "WED") ans =4;
  else if(s == "THU") ans =3;
  else if(s == "FRI") ans =2;
  else if(s == "SAT") ans =1;
  
  cout<< len << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'String' was not declared in this scope
    4 |         String s;
      |         ^~~~~~
a.cc:5:16: error: 's' was not declared in this scope
    5 |         cin >> s;
      |                ^
a.cc:16:10: error: 'len' was not declared in this scope; did you mean 'mblen'?
   16 |   cout<< len << endl;
      |          ^~~
      |          mblen
Language: Java

class solution{
	public static void main(String args[]){
    	Scanner sc = new Scanner(System.in);
      	String str = sc.nextLine();
      
      	if(str.equals("SUN"))
          System.out.println(7);
      	else if(str.equals("MON"))
          System.out.println(6);
      	else if(str.equals("TUE"))
          System.out.println(5);
      	else if(str.equals("WED"))
          System.out.println(4);
      	else if(str.equals("THU"))
          System.out.println(3);
      	else if(str.equals("FRI"))
          System.out.println(2);
      	else if(str.equals("SAT"))
          System.out.println(1);
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
    	Scanner sc = new Scanner(System.in);
    	^
  symbol:   class Scanner
  location: class solution
Main.java:3: error: cannot find symbol
    	Scanner sc = new Scanner(System.in);
    	                 ^
  symbol:   class Scanner
  location: class solution
2 errors
Language: Java

class solution{
	public static void main(String args[]){
    	Scanner sc = new Scanner(System.in);
      	String str = sc.nextLine();
      
      	if(str.equals("SUN"))
          System.out.println(7);
      	elseif(str.equals("MON"))
          System.out.println(6);
      	else if(str.equals("TUE"))
          System.out.println(5);
      	else if(str.equals("WED"))
          System.out.println(4);
      	else if(str.equals("THU"))
          System.out.println(3);
      	else if(str.equals("FRI"))
          System.out.println(2);
      	else if(str.equals("SAT"))
          System.out.println(1);
    }
}

Compiler output:
Main.java:8: error: ';' expected
      	elseif(str.equals("MON"))
      	                         ^
Main.java:10: error: 'else' without 'if'
      	else if(str.equals("TUE"))
      	^
2 errors
Language: C++

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

#define     fast()              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
#define     ll                  long long int
#define     test()              ll t; cin>>t; while(t--) 
#define     lp0(i,begin,end)    for(ll i=begin;i<end;i++)
#define     lp1(i,begin,end)    for(ll i=begin;i<=end;i++)
#define     rlp(i,begin,end)    for(ll i=end;i>=begin;i--)
#define     prec(n)             fixed<<setprecision(n)
#define     initial(a,i)        memset(a,i,sizeof(a))
#define     pb                  push_back
#define     PI                  3.1415926535897932384626433832795
#define     MOD                 1000000007
#define     F                   first
#define     S                   second
#define     all(a)              (a).begin(),(a).end()
#define     BPC(x)              __builtin_popcountll(x)
#define     gcd(a,b)            __gcd(a,b)

ll gcd(ll a,ll b) {if (a==0) return b;return gcd(b%a,a);}

ll power(ll x,ll n)
{
    ll result = 1;
    while (n)
    {
        if (n & 1)
            result = result * x;
        n = n / 2;
        x = x * x;
    }
    return result;
}


// Solution Function
void solution(ll compte)
{
    // cout<<compte<<"\n";
    vector<string> D = {"SUN","MON","TUE","WED","THU","FRI","SAT"}; 
    string S;
    cin >> S;
    int ans=0;
    lp0(i,7)
    if(D[i]==S) 
        ans = 7-i;
    cout << ans << endl;
}
// Driver Function
int main()
{
    ll compte = 1;
    //test()
    //{
        solution(compte);
        compte++;
    //}
    return 0;
}


Compiler output:
a.cc:46:12: error: macro "lp0" requires 3 arguments, but only 2 given
   46 |     lp0(i,7)
      |            ^
a.cc:8:13: note: macro "lp0" defined here
    8 | #define     lp0(i,begin,end)    for(ll i=begin;i<end;i++)
      |             ^~~
a.cc: In function 'void solution(long long int)':
a.cc:46:5: error: 'lp0' was not declared in this scope
   46 |     lp0(i,7)
      |     ^~~
Language: C++

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

#define     fast()              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
#define     ll                  long long int
#define     test()              ll t; cin>>t; while(t--) 
#define     lp0(i,begin,end)    for(ll i=begin;i<end;i++)
#define     lp1(i,begin,end)    for(ll i=begin;i<=end;i++)
#define     rlp(i,begin,end)    for(ll i=end;i>=begin;i--)
#define     prec(n)             fixed<<setprecision(n)
#define     initial(a,i)        memset(a,i,sizeof(a))
#define     pb                  push_back
#define     PI                  3.1415926535897932384626433832795
#define     MOD                 1000000007
#define     F                   first
#define     S                   second
#define     all(a)              (a).begin(),(a).end()
#define     BPC(x)              __builtin_popcountll(x)
#define     gcd(a,b)            __gcd(a,b)

ll gcd(ll a,ll b) {if (a==0) return b;return gcd(b%a,a);}

ll power(ll x,ll n)
{
    ll result = 1;
    while (n)
    {
        if (n & 1)
            result = result * x;
        n = n / 2;
        x = x * x;
    }
    return result;
}


// Solution Function
void solution(ll compte)
{
    // cout<<compte<<"\n";
    vector<string> D = {"SUN","MON","TUE","WED","THU","FRI","SAT"}; 
    string S;
    cin >> S;
    int ans=0;
    rep(i,7)
    if(D[i]==S) 
        ans = 7-i;
    cout << ans << endl;
}
// Driver Function
int main()
{
    ll compte = 1;
    //test()
    //{
        solution(compte);
        compte++;
    //}
    return 0;
}


Compiler output:
a.cc: In function 'void solution(long long int)':
a.cc:46:9: error: 'i' was not declared in this scope
   46 |     rep(i,7)
      |         ^
a.cc:46:5: error: 'rep' was not declared in this scope; did you mean 'rlp'?
   46 |     rep(i,7)
      |     ^~~
      |     rlp
Language: C++

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

#define vt          vector
#define sz(x)       int((x).size())
#define all(x)      (x).begin(), (x).end()
#define rall(x)     (x).rbegin(), (x).rend()
#define fi          first
#define se          second

using ll = long long;
using pii = pair<int, int>;

void solve() {
    map<string, int> m{
        {"SUN", 7},
        {"MON", 6},
        {"TUE", 5},
        {"WED", 4},
        {"THU", 3},
        {"FRI", 2},
        {"SAT", 1}
    }

    string s;
    cin >> s;
    cout << m[s];
}

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

    int tcs = 1;
    for (int tc = 1; tc <= tcs; tc++) {
        // cout << "Case " << tc << ": ";
        solve();
    }
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:25:5: error: expected ',' or ';' before 'string'
   25 |     string s;
      |     ^~~~~~
a.cc:26:12: error: 's' was not declared in this scope
   26 |     cin >> s;
      |            ^
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(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
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; }
//const ll INF = 1LL << 60;#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(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
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; }
//const ll INF = 1LL << 60;
//const int INF = 1001001001;
const string t[7]={"SUN","MON","TUE","WED","THU","FRI","SAT"};

int main(void){
    string s;
    cin >> s;
    int ans;
    REP(i,7){  
        if(t[i]==s) ans=i;
    }
    if(ans==0) ans=7;
    cout << ans;
    return 0;
}
//const int INF = 1001001001;
const string t[7]={"SUN","MON","TUE","WED","THU","FRI","SAT"};

int main(void){
    string s;
    cin >> s;
    int ans;
    REP(i,7){  
        if(t[i]==s) ans=i;
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc:19:31: error: redefinition of 'template<class T> bool chmin(T&, T)'
   19 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:9:31: note: 'template<class T> bool chmin(T&, T)' previously declared here
    9 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:20:31: error: redefinition of 'template<class T> bool chmax(T&, T)'
   20 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:10:31: note: 'template<class T> bool chmax(T&, T)' previously declared here
   10 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:37:14: error: redefinition of 'const std::string t [7]'
   37 | const string t[7]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
      |              ^
a.cc:23:14: note: 'const std::string t [7]' previously declared here
   23 | const string t[7]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
      |              ^
a.cc:39:5: error: redefinition of 'int main()'
   39 | int main(void){
      |     ^~~~
a.cc:25:5: note: 'int main()' previously defined here
   25 | int main(void){
      |     ^~~~
Language: C

#include<stdio.h>

int main(void){
  char c[10]:
  scanf("%s",c);
  if(c=="SUN"){
    printf("7\n");
  }else if(c=="MON"){
    printf("6\n");
  }else if(c=="TUE"){
    printf("5\n");
  }else if(c=="WED"){
    printf("4\n");
  }else if(c=="THU"){
    printf("3\n");
  }else if(c=="FRI"){
    printf("2\n");
  }else if(c=="SAT"){
    printf("1\n");
  }
     
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    4 |   char c[10]:
      |             ^
main.c:4:13: error: expected expression before ':' token
main.c:6:6: error: 'c' undeclared (first use in this function)
    6 |   if(c=="SUN"){
      |      ^
main.c:6:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <string>

int main() {
  std::vector<std::string> s = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
  std::string d; std::cin >> d;
  int ans;
  for (int i = 0; i < 7; ++i) {
    if (s[i] == d) ans = 7-i;
  }
  std::cout << ans << std::endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 'vector' is not a member of 'std'
    5 |   std::vector<std::string> s = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
      |        ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:5:26: error: expected primary-expression before '>' token
    5 |   std::vector<std::string> s = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
      |                          ^
a.cc:5:28: error: 's' was not declared in this scope
    5 |   std::vector<std::string> s = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
      |                            ^
Language: C++

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

int main() {
  string A;
  cin>>A;
  switch(A){
    case "SUN":
      cout<<7<<endl;
      break;
    case "MON":
      cout<<6<<endl;
      break;
    case "TUE":
      cout<<5<<endl;
      break;
    case "WED":
      cout<<4<<endl;
      break;
    case "THU":
      cout<<3<<endl;
      break;
    case "FRI":
      cout<<2<<endl;
      break;
    default:
      cout<<1<<endl;
      break;
  }
  return 0;
}
     

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: switch quantity not an integer
    7 |   switch(A){
      |          ^
Language: C++

#include <bits/stdc++.h>
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);
#define ADD +
#define SUBTRACT -
#define MULTIPLY *
#define DIVIDE /
#define MOD %
#define INCREMENT(x) ++x
#define DECREMENT(x) --x
#define in(a,b) cin>>a>>b;
#define out(a,b) cout<<a<<endl<<b<<endl;
#define scan(a) scanf("%d",&a);
#define print(a) printf("%d\n",a);
#define scanii(a,b) scanf("%d %d",&a,&b);
#define printii(a,b) printf("%d\n%d\n",a,b);
#define scaniii(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define ll long long
#define ull unsigned long long
#define sll signed long long
#define pi acos(-1)
#define mod 1000000007
#define TRUE 1
#define FALSE 0
#define ZERO 0
#define MP make_pair
#define F first
#define S second
#define f1(i,a) for(int i=0;i<a;++i)
#define f2(i,a) for(int i=a-1;i>=0;--i)
#define en puts("");
#define elif else if
typedef ll int lli;
typedef sll int slli;
typedef ull int ulli;
const int sz=10000;
using namespace std;

int clue();
int result();
void show();
bool check(int n) {
    for(int i=2;i*i<=n;++i) {
        if(n%i==0)
        return false;
    }
    return true;
}


// bool cmp(pair<int,int>p,pair<int,int>q) {
//     // return p.first>q.first;//descending by first
//     // return p.first<q.first;//ascending by first
//     // return p.second>q.second;//descending by second
//     return p.second<q.second;//ascending by second
// }

bool cmp(int p,int q) {
    return p>q;//descending
    // return p<q;//ascending
}


int main() {

    int t;
    // cin>>t;
    t=1;
    while(t-->0) {
        clue();
    }

    return 0;
}
int clue() {

    string s;
    cin>>s;
    int cnt;
    if(s=="SUN") {
        cnt=7;
    }
    elif(s=="MON") {
        cnt=6;
    }
    elif(s=="TUE") {
        cnt=5;
    }
    elif(s=="WED") {
        cnt=4;
    }
    elif(s=="THU") {
        cnt=3
    }
    elif(s=="FRI") {
        cnt=2;
    }
    elif(s=="SAT") {
        cnt=1;
    }

    cout<<cnt<<endl

    
    // ()?cout<<"1"<<endl:cout<<"0"<<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int clue()':
a.cc:96:14: error: expected ';' before '}' token
   96 |         cnt=3
      |              ^
      |              ;
   97 |     }
      |     ~         
a.cc:105:20: error: expected ';' before 'return'
  105 |     cout<<cnt<<endl
      |                    ^
      |                    ;
......
  110 |     return 0;
      |     ~~~~~~          
a.cc:111:1: warning: no return statement in function returning non-void [-Wreturn-type]
  111 | }
      | ^
Language: C++

#include <iostream>

using namespace std;
using ll = long long;
using pint = pair<int, int>;

int main() {
	string S;
	vector<string> W = { "SUN","MON","TUE","WED","THU","FRI","SAT" };
	cin >> S;
	
	for (int i = 0; i < W.size(); ++i) {
		if (S == W[i]) {
			cout << 7 - i << endl;
			return 0;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'vector' was not declared in this scope
    9 |         vector<string> W = { "SUN","MON","TUE","WED","THU","FRI","SAT" };
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:9:22: error: expected primary-expression before '>' token
    9 |         vector<string> W = { "SUN","MON","TUE","WED","THU","FRI","SAT" };
      |                      ^
a.cc:9:24: error: 'W' was not declared in this scope
    9 |         vector<string> W = { "SUN","MON","TUE","WED","THU","FRI","SAT" };
      |                        ^