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

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll N;
    cin >> N;
    vector<tuple<ll, ll, ll>> A(N - 1);
    rep(i, N - 1) {
        ll C, S, F;
        cin >> C >> S >> F;
        A[i] = tuple<ll, ll, ll>{C, S, F};
    }
    rep(i, N) {
        ll t = 0;
        rep2(j, i, N - 1) {
            ll temp = t - get<1>(A[j]);
            if(temp < 0) temp = 0;
            t = get<2>(A[j]) * (temp / get<2>(A[j]) + !!(temp % get<2>(A[j])) + get<1>(A[j]) + get<0>(A[j]);
        }
        cout << t << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:108: error: expected ')' before ';' token
   59 |             t = get<2>(A[j]) * (temp / get<2>(A[j]) + !!(temp % get<2>(A[j])) + get<1>(A[j]) + get<0>(A[j]);
      |                                ~                                                                           ^
      |                                                                                                            )
Language: C++

int main(){
    int n;
    cin >> n;
 
    int c[n], s[n], f[n];
    c[n-1] = s[n-1] = f[n-1] = 0;
    for(int i = 0; i < n-1; i++)  cin >> c[i] >> s[i] >> f[i];
 
    for(int i = 0; i < n-1; i++){
        int ans = 0;
        for(int j = i; j < n-1; j++){
            if(ans <= s[j])  ans = s[j];
            else            ans = (ans-s[j]+f[j]-1)/f[j]*f[j] + s[j];
            ans += c[j];
        }
        cout << ans << endl;
    }
 
    cout << 0 << endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n;
      |     ^~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << ans << endl;
      |         ^~~~
a.cc:16:24: error: 'endl' was not declared in this scope
   16 |         cout << ans << endl;
      |                        ^~~~
a.cc:19:5: error: 'cout' was not declared in this scope
   19 |     cout << 0 << endl;
      |     ^~~~
a.cc:19:18: error: 'endl' was not declared in this scope
   19 |     cout << 0 << endl;
      |                  ^~~~
Language: C++

#include <cstdio > bool f[100001]; int c[100002]; int N,L,R; int main() { for(int i=2;i<=100000;i++)if(!f[i])for(int j=i+i;j<=100000;j+=i) f[j]=true; for(int i=3;i<=100000;i+=2)if(!f[i]&&!f[(i+1)/2])c[i]++; for(int i=3;i<=100000;i++)c[i]+=c[i-1]; scanf("%d",&N); while(N--) { scanf("%d%d",&L,&R); printf("%d\n",c[R]-c[L-1]); } }

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <cstdio > bool f[100001]; int c[100002]; int N,L,R; int main() { for(int i=2;i<=100000;i++)if(!f[i])for(int j=i+i;j<=100000;j+=i) f[j]=true; for(int i=3;i<=100000;i+=2)if(!f[i]&&!f[(i+1)/2])c[i]++; for(int i=3;i<=100000;i++)c[i]+=c[i-1]; scanf("%d",&N); while(N--) { scanf("%d%d",&L,&R); printf("%d\n",c[R]-c[L-1]); } }
      |                    ^~~~
a.cc:1:10: fatal error: cstdio : No such file or directory
    1 | #include <cstdio > bool f[100001]; int c[100002]; int N,L,R; int main() { for(int i=2;i<=100000;i++)if(!f[i])for(int j=i+i;j<=100000;j+=i) f[j]=true; for(int i=3;i<=100000;i+=2)if(!f[i]&&!f[(i+1)/2])c[i]++; for(int i=3;i<=100000;i++)c[i]+=c[i-1]; scanf("%d",&N); while(N--) { scanf("%d%d",&L,&R); printf("%d\n",c[R]-c[L-1]); } }
      |          ^~~~~~~~~
compilation terminated.
Language: C++

include <bits/stdc++.h>
using namespace std;
     
int main(){
  int N;
  cin>>N;
  vector<int> C(N),S(N),F(N);
  
  for(int i=0; i<N-1; i++) cin>>C[i]>>S[i]>>F[i];
  
  for(int i=0; i<N; i++){
    if(i == N-1){
      cout<<0<<endl;
      return 0;
    }
    
    int tm = 0;
    tm += S[i];
    tm += tm%F[i];
    tm += C[i];
    
    for(int j=i+1; j<N-1; j++){
      if(S[j] > tm) tm += (S[j]-tm);
      else tm += tm%F[j];
      tm += C[j];
    }
    
    cout<<tm<<endl;
  }
  
  
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>N;
      |   ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> C(N),S(N),F(N);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> C(N),S(N),F(N);
      |          ^~~
a.cc:9:33: error: 'C' was not declared in this scope
    9 |   for(int i=0; i<N-1; i++) cin>>C[i]>>S[i]>>F[i];
      |                                 ^
a.cc:9:39: error: 'S' was not declared in this scope
    9 |   for(int i=0; i<N-1; i++) cin>>C[i]>>S[i]>>F[i];
      |                                       ^
a.cc:9:45: error: 'F' was not declared in this scope
    9 |   for(int i=0; i<N-1; i++) cin>>C[i]>>S[i]>>F[i];
      |                                             ^
a.cc:13:7: error: 'cout' was not declared in this scope
   13 |       cout<<0<<endl;
      |       ^~~~
a.cc:13:16: error: 'endl' was not declared in this scope
   13 |       cout<<0<<endl;
      |                ^~~~
a.cc:18:11: error: 'S' was not declared in this scope
   18 |     tm += S[i];
      |           ^
a.cc:19:14: error: 'F' was not declared in this scope
   19 |     tm += tm%F[i];
      |              ^
a.cc:20:11: error: 'C' was not declared in this scope
   20 |     tm += C[i];
      |           ^
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout<<tm<<endl;
      |     ^~~~
a.cc:28:15: error: 'endl' was not declared in this scope
   28 |     cout<<tm<<endl;
      |               ^~~~
Language: C++

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

int main(){
  int N;
  cin>>N;
  vector<int> C(N-1),S(N-1),F(N-1);

  for(int i=0; i<N-1; i++) cin>>C[i]>>S[i]>>F[i];

  for(int i=0; i<=N; i++){
    if(i == N){
      cout<<0<<endl;
      return 0;
    }

    int tm = 0;
    tm += C[i]+S[i];

    for(int j=i+1; j<N-1; j++){
      if(S[j] > tm) tm += (S[j]-tm);
      else tm += tm%F[j];
      tm += C[j];
    }

    cout<<tm<<endl;
  }

 
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>N;
      |   ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> C(N-1),S(N-1),F(N-1);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> C(N-1),S(N-1),F(N-1);
      |          ^~~
a.cc:9:33: error: 'C' was not declared in this scope
    9 |   for(int i=0; i<N-1; i++) cin>>C[i]>>S[i]>>F[i];
      |                                 ^
a.cc:9:39: error: 'S' was not declared in this scope
    9 |   for(int i=0; i<N-1; i++) cin>>C[i]>>S[i]>>F[i];
      |                                       ^
a.cc:9:45: error: 'F' was not declared in this scope
    9 |   for(int i=0; i<N-1; i++) cin>>C[i]>>S[i]>>F[i];
      |                                             ^
a.cc:13:7: error: 'cout' was not declared in this scope
   13 |       cout<<0<<endl;
      |       ^~~~
a.cc:13:16: error: 'endl' was not declared in this scope
   13 |       cout<<0<<endl;
      |                ^~~~
a.cc:18:11: error: 'C' was not declared in this scope
   18 |     tm += C[i]+S[i];
      |           ^
a.cc:18:16: error: 'S' was not declared in this scope
   18 |     tm += C[i]+S[i];
      |                ^
a.cc:22:21: error: 'F' was not declared in this scope
   22 |       else tm += tm%F[j];
      |                     ^
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout<<tm<<endl;
      |     ^~~~
a.cc:26:15: error: 'endl' was not declared in this scope
   26 |     cout<<tm<<endl;
      |               ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

struct time {
	int c, s, f;
};

int main() {
	int n;
	cin >> n;
	vector<time> t(n - 1);
	for (int i = 0; i < n - 1; i++)
		cin >> t[i].c >> t[i].s >> t[i].f;
	for (int i = 0; i < n; i++) {
		int ti = 0;
		for (int j = i; j < n - 1; j++) {
			if (ti < t[j].s)
				ti = t[j].s;
			else if (ti % t[j].f != 0)
				ti += t[j].f - ti % t[j].f;
			ti += t[j].c;
		}
		cout << ti << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   12 |         vector<time> t(n - 1);
      |                    ^
a.cc:12:20: note:   expected a type, got 'time'
a.cc:12:20: error: template argument 2 is invalid
a.cc:14:25: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> t[i].c >> t[i].s >> t[i].f;
      |                         ^
a.cc:14:35: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> t[i].c >> t[i].s >> t[i].f;
      |                                   ^
a.cc:14:45: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> t[i].c >> t[i].s >> t[i].f;
      |                                             ^
a.cc:18:35: error: invalid types 'int[int]' for array subscript
   18 |                         if (ti < t[j].s)
      |                                   ^
a.cc:19:39: error: invalid types 'int[int]' for array subscript
   19 |                                 ti = t[j].s;
      |                                       ^
a.cc:20:40: error: invalid types 'int[int]' for array subscript
   20 |                         else if (ti % t[j].f != 0)
      |                                        ^
a.cc:21:40: error: invalid types 'int[int]' for array subscript
   21 |                                 ti += t[j].f - ti % t[j].f;
      |                                        ^
a.cc:21:54: error: invalid types 'int[int]' for array subscript
   21 |                                 ti += t[j].f - ti % t[j].f;
      |                                                      ^
a.cc:22:32: error: invalid types 'int[int]' for array subscript
   22 |                         ti += t[j].c;
      |                                ^
Language: C++

#include<bits/stdc++.h>
#include <math.h>
#include <map>
#include <unordered_map>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define ci(x) cin >>x
#define co(x) cout<<x<<endl
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
long long fac(ll a) {
 long long ans=1;
 while(a>1){
 ans*=a;
 ans%=1000000007;
     a--;
    }
    return ans;
     }
int N,C[500],S[500],F[500]; int main ()
{
scanf("%d",&N);
for(int i=0;i<N-1;i++)scanf("%d%d%d",&C[i],&S[i],&F[i]); for(int i=0;i<N;i++)
{
int t=0;
for(int j=i;j<N-1;j++) {
if(t<S[j])t=S[j]; else if(t%F[j]==0); else t=t+F[j]-t%F[j]; t+=C[j];
} printf("%d\n",t);
}


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

#include <cstdio >
int N,C[500],S[500],F[500]; int main ()
{
scanf("%d",&N);
for(int i=0;i<N-1;i++)scanf("%d%d%d",&C[i],&S[i],&F[i]); for(int i=0;i<N;i++)
{
int t=0;
for(int j=i;j<N-1;j++) {
if(t<S[j])t=S[j]; else if(t%F[j]==0); else t=t+F[j]-t%F[j]; t+=C[j];
} printf("%d\n",t);
}

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

# include < cstdio >
int N , C [500] , S [500] , F [500];
int main ()
{
scanf ("% d " ,& N );
for ( int i =0; i <N -1; i ++) scanf ("% d % d % d " ,& C [ i ] ,& S [ i ] ,& F [ i ]);
for ( int i =0; i < N ; i ++)
{
int t =0;
for ( int j = i ;j <N -1; j ++)
{
if (t < S [ j ]) t = S [ j ];
else if ( t % F [ j ]==0);
else t = t + F [ j ] - t % F [ j ];
t += C [ j ];
}
printf ("% d \ n " , t );
}
}


Compiler output:
a.cc:1:11: fatal error:  cstdio : No such file or directory
    1 | # include < cstdio >
      |           ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.Scanner;
public class Main084c {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		
		int []c = new int [n];
		int []s = new int [n];
		int []f = new int [n];
		
		for(int i = 0 ;i < n-1 ;i++) {
			c[i] = Integer.parseInt(sc.next());
			s[i] = Integer.parseInt(sc.next());
			f[i] = Integer.parseInt(sc.next());
		}
		int []t = new int [n];
		for(int i = 0 ;i < n-1 ;i++) {
			t[i] = 0;
			for(int j = i ; j < n-1 ;j++) {
				if(t[i] < s[j])
					t[i] = s[j] + c[j];
				else {
					if(t[i]%f[j] == 0) {
						t[i] += c[j];
					}
					else {
						int temp = t[i] % f[j];
						t[i] += (s[i] - temp) + c[j];
					}
					
				}
			}
		}
		
		t[n-1] = 0;
		
		for(int i = 0 ; i < n; i++) {
			System.out.println(t[i]);
		}
	}
}


Compiler output:
Main.java:2: error: class Main084c is public, should be declared in a file named Main084c.java
public class Main084c {
       ^
1 error
Language: C++

//C - Special Trains: 
//Assunto: 
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define loop(i, a, b) for(int i = a; i < b; i++)
#define loopBack(i, a, b) for(int i = a; i >= b; i--)
#define INF INT_MAX
#define LINF LLONG_MAX
#define DINF DBL_MAX
#define MAX 100005
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    int n;
    ll ans, aux;
    cin >> n;
    vector<int> c(n), s(n), f(n);
    loop(i, 1, n) cin >> c[i] >> s[i] >> f[i];
    loop(j, 1, n+1) {
        ans = 0;
        loop(i, j, n) {
            if(ans <= s[i]) ans = s[i];a
            else if(ans % f[i] == 0);
            else ans += f[i] - (ans % f[i]);
            ans += c[i];
        }
        cout << ans << "\n";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:40: error: 'a' was not declared in this scope
   32 |             if(ans <= s[i]) ans = s[i];a
      |                                        ^
a.cc:34:13: error: 'else' without a previous 'if'
   34 |             else ans += f[i] - (ans % f[i]);
      |             ^~~~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
ll q[4]={0,1,-1,0};
ll w[4]={1,0,0,-1};
int main(){
  ll h,w;
  cin>>h>>w;
  vector<vector<char>> t(h+2,vector<char> (w+2,'.'));
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      char a;
      cin>>a;
      t[i][j]=a;
    }
  }
  
  for(int i=1;i<h+1;i++){
    for(int j=1;j<=w;j++){
      if(t[i][j]=='#'){
        ll cu=1;
        rep(u,4){
          if(t[i+q[u]][j+w[u]]=='#'){
            cu=0;
          }
        }
        if(cu){
          COUT("No");
          return 0;
        }
      }
    }
  }
  COUT("Yes");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:27: error: invalid types 'long long int[long long int]' for array subscript
   57 |           if(t[i+q[u]][j+w[u]]=='#'){
      |                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> c(500);
vector<int> s(500);
vector<int> f(500);

int dfs(int t, int n){
  if(n+1==N)return t;
  int tmp;
  if(s[n]<=t)tmp = t%f[n]+c[n];
  else tmp = s[n]-t+c[n];
  return dfs(t+tmp, n+1);
}

int main(){
  cin>>N;
  for(int i=0;i<n;i++){
    cin >> c[i] >> s[i] >> f[i];
  }
  for(int i=0; i<N; i++){
    cout << dfs(0,i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'n' was not declared in this scope
   18 |   for(int i=0;i<n;i++){
      |                 ^
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);


ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b){
  ll r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return b;
}


ll LCM(ll a,ll b){
  ll c=a,d=b,r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return c/b*d;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

vector<pair<char,ll>> runlength(string s,vector<pair<char,ll>> p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
    return p;
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
  return p;
}



/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll n;
  cin>>n;
  vector<ll> c(n-1),s(n-1),f(n-1);
  rep(i,n) cin>>c[i]>>s[i]>>f[i];
  rep(i,n){
    ll t=0;
    for(ll j=i;j<n-1){
      if(t<s[j]){
        t=s[j];
      }else if(t%f[j]!=0){
        t+=f[j]-t%f[j];
      }
      t+=c[j];
    }
    cout<<t<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:103:21: error: expected ';' before ')' token
  103 |     for(ll j=i;j<n-1){
      |                     ^
      |                     ;
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll =long long;
using db = double;

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; }

#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(v) SORT(v);(v).erase(unique((v).begin(),(v).end()),(v).end())
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;
const ll INF = 1LL << 60;

//ここから書き始める
int main()
{
	cout << setprecision(10);
	int n;
	cin >> n;
	vector<int> c(n-1),s(n-1),f(n-1);
	rep(i,n-1) cinn >> c[i]>> s[i]>> f[i];

	rep(i,n-1){
		int x = 0;
		For(j,i,n-1){
			if(x<=s[j]) x = s[j]+c[j];
			else{
				x -=s[j];
				x = (x+f[j]-1)/f[j] *f[j];
				x+=s[j];
				x+=c[j];
			}
		}
		cout << x<<endl;
	}
	cout << 0 << endl;

}


Compiler output:
a.cc: In function 'bool coY()':
a.cc:18:32: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | bool coY() {cout <<"Yes"<<endl;}
      |                                ^
a.cc: In function 'bool coN()':
a.cc:19:30: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | bool coN(){cout <<"No"<<endl;}
      |                              ^
a.cc: In function 'int main()':
a.cc:30:20: error: 'cinn' was not declared in this scope
   30 |         rep(i,n-1) cinn >> c[i]>> s[i]>> f[i];
      |                    ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
 
using namespace std;
 
int main (){
  
  int a,b[510],c[510],d[510],t;
  
  for(int i =0;i<a;i++){
    cin >> b[i]>>c[i]>>d[i];
  }
    t =0;
  for(int i=0;i<a;i++){
    
     for(int j =i;j<a-1;j++){
       
       if(t<c[j]){
         t = c[j];
       }
       else if(t%d[j] ==0){
         
           t = t+d[j];
         }
       
       
       t += b[j];
     }
    cout << t << endl;
    
  
}
         


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

#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
 
using namespace std;
 
int main (){
  
  int a,b[510],c[510],d[510],t;
  
  for(int i =0;i<a;i++){
    cin >> b[i]>>c[i]>>d[i];
  }
    t =0;
  for(int i=0;i<a;i++){
    
     for(int j =i;j<a-1;j++){
       
       if(t<c[j]){
         t = c[j];
       }
       else if(t%d[j] ==0){
         else{
           t = t+d[j];
         }
       }
       t += b[j];
     }
    cout << t << endl;
    
  
}
         


Compiler output:
a.cc: In function 'int main()':
a.cc:23:10: error: expected '}' before 'else'
   23 |          else{
      |          ^~~~
a.cc:22:27: note: to match this '{'
   22 |        else if(t%d[j] ==0){
      |                           ^
a.cc:27:15: error: 'j' was not declared in this scope
   27 |        t += b[j];
      |               ^
Language: C++

#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
 
using namespace std;
 
int main (){
  
  int a,b[510],c[510],d[510],t;
  
  for(int i =0;i<a;i++){
    cin >> b[i]>>c[i]>>d[i];
  }
    t =0;
  for(int i=0;i<a;i++){
     for(int j =i;j<a-1;j++){
       
       if(t<c[j]){
         t = c[j];
       }
       else if(t%d[j] ==0){
         else{
           t = t+d[j];
         }
       }
       t += b[j];
     }
    cout << t << endl;
    
  }
}
         

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: expected '}' before 'else'
   22 |          else{
      |          ^~~~
a.cc:21:27: note: to match this '{'
   21 |        else if(t%d[j] ==0){
      |                           ^
a.cc:26:15: error: 'j' was not declared in this scope
   26 |        t += b[j];
      |               ^
a.cc: At global scope:
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

#include "bits/stdc++.h"

using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;  
typedef pair<pair<ll, ll >, ll > pii;  
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;

int main(){

    ll N;
    cin >> N;

    vector<ll > ans; 

    vector<pii > input;

    for(ll i = 0; i < N - 1; i++){
        ll c, s, f; cin >> c >> s >> f;
        input.push_back(make_pair(make_pair(c, s), f));
    }

    for(ll i = 0; i < N - 1; i++){
        ll time = 0;
        //cout << i << endl;
        for(ll j = i; j < N - 1; j++){
            ll c = input[j].first.first;
            ll s = input[j].first.second;
            ll f = input[j].second;

            ll cn = 1;
            if(s =< time){
                while(s + f * cn <= time){
                    cn++;
                }
                time = s + f * (cn - 1) + c;
            }else{
                time += (s - time) + c;
            }

            
            //cout << time << " ";
        }
        ans.push_back(time);
       // cout << endl;
    }

    ans.push_back(0);


    for(ll i = 0; i < N; i++){
        cout << ans[i] << endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:19: error: expected primary-expression before '<' token
   34 |             if(s =< time){
      |                   ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  int C[N-1], S[N-1], F[N-1];
  rep(i, N-1){
    cin >> C[i] >> S[i] >> F[i];
  }
  int ans[N];
  rep(i, N-1){
    ans[i] = S[i];
    for(int j=i; j<N-1; j++){
      ans[i] += C[j];
      if(j < N-2){
        if(ans[i] < S[j+1])
          ans[i] = S[j+1];
        else if(ans[i]%F[j+1] != 0) ans[i] += (F[j+1] - ans[i]%F[j+1]);
      }
    }
  }
  ans[N-1] = 0;
  rep(i, N){
    cout << ans[i] << endl;
  }
  

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

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

int main() {
  int n;
  cin >> n;
  vector<int> C(n), S(n), F(n);
  rep(i, 0, n-1) cin >> C[i] >> S[i] >> F[i];

  rep(i, 0, n-1) {
    int ans = 0;
    rep(j, i+1, n) {
      if (ans < S[j-1]) ans = S[j-1];
      else if (ans % F[j-1] == 0);
      else ans = ans + F[j-1] - t%F[j-1];
      ans += C[j-1];
    }
    cout << ans << endl;
  }
  cout << 0 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:33: error: 't' was not declared in this scope
   17 |       else ans = ans + F[j-1] - t%F[j-1];
      |                                 ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define RFOR(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define REP(i,n) FOR(i,0,(n))
#define REPS(i,n) FOR(i,1,(n)+1)
#define RREP(i,n) RFOR(i,0,(n))
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define DEBUG(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(ALL(x));
#define RSORT(x) sort(RALL(x));
#define SUM(x) accumulate(ALL(x),0);
#define FI first
#define SE second
#define PB push_back
#define EB emplace_back
#define SZ(x) (int)(x).size()
#define BN(x) ((1<<x)-1)
#define DUP(x,y) (((x)+(y)-1)/(y))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const ll mod = 1e9+7;
const int INF = (1<<30)-1;
const ll INFLL = (1LL<<62)-1;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

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

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main () {
  int N; cin >> N;
  vi C(N-1), S(N-1), F(N-1); REP(i,N-1) cin >> C[i] >> S[i] >> F[i];

  REP(i,N) {
    int t = 0;
    FOR(j,i,N-1) {
      if (t < S[j]) {
        t = S[j];
      }
      else if (t%F[j]==0) {
        ;
      }
      else {
        t = t+F[j]-t%F[j];
      }
      
    cout << t << "\n";
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:2: error: expected '}' at end of input
   58 | }
      |  ^
a.cc:39:13: note: to match this '{'
   39 | int main () {
      |             ^
Language: C++

#include <iostream>

using std::cout;
using std::endl;
using std::cin;

int C[510];// Cost to reach next station
int S[510];// Time of start
int F[510];// TIme of next train start
// S[i] % F[i] = 0

int main() {
	// Input
	int N;// Number of stations.
	cin >> N;
	for(int i = 0; i < N - 1; ++i) {
		cin >> C[i] >> S[i] >> F[i];
	}
	// Calculation
	for(int i = 0; i < N; ++i) {
		int t = 0;
		for(int j = i; j < N - 1; ++j) {
			if(t < S[j]) t = S[j];
			else if(t % F[j] == 0);
			else t += F[j] - t % F[j];
			t += C[j]:
		}
		// Output
		cout << t << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:34: error: expected ';' before ':' token
   26 |                         t += C[j]:
      |                                  ^
      |                                  ;
Language: C++

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

int main(){
  int a;
  cin>>a;
  vector<tuple<int,int,int>> b(a-1);
  for(int i=0;i<a-1;i++){
    cin>>get<0>(b.at(i))>>get<1>(b.at(i))>>get<2>(b.at(i));
  }
  vector<tuple<int,int,int>> c=b;
    for(int i=0;i<a;i++){
      if(i==a-1)
        cout<<0<<endl;
      for(int j=i;j<a-1;j++){
      while(get<1>(b.at(i))+get<0>(b.at(i))<get<1>(b.at(i+1))||get<1>(b.at(i-1))+get<0>(b.at(i))<get<1>(b.at(i)))
      get<1>(b.at(i))+=get<2>(b.at(i));
      

Compiler output:
a.cc: In function 'int main()':
a.cc:17:40: error: expected '}' at end of input
   17 |       get<1>(b.at(i))+=get<2>(b.at(i));
      |                                        ^
a.cc:15:29: note: to match this '{'
   15 |       for(int j=i;j<a-1;j++){
      |                             ^
a.cc:17:40: error: expected '}' at end of input
   17 |       get<1>(b.at(i))+=get<2>(b.at(i));
      |                                        ^
a.cc:12:25: note: to match this '{'
   12 |     for(int i=0;i<a;i++){
      |                         ^
a.cc:17:40: error: expected '}' at end of input
   17 |       get<1>(b.at(i))+=get<2>(b.at(i));
      |                                        ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

#define mod 1000000007

using namespace std;
typedef long long ll; 
 
int main(void){
	
	int N;
	
	cin >> N;
	
	int C[N-1], S[N-1], F[N-1], ans[N] = {};
	
	for(int i=0; i<N-1; i++)
		cin >> C[i] >> S[i] >> F[i];
	
	for(int i=0; i<N-1; i++){
		for(int j=i; j<N-1; j++){
			if(ans < S[j])
				ans[i] = S[j];
			else if(ans[i] % F[j] == 0);
			else
				ans[i] += F[j] - ans[i]%F[j];
			ans[i] += C[j];
		}
		cout << ans[i] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |                         if(ans < S[j])
      |                            ~~~~^~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int N;
  cin >> N;
  int n = N - 1;
  vector<int> C(n), S(n), F(n);
  for(int i = 0; i < n; i++){
    cin >> C[i] >> S[i] >> F[i];
  }
  
  
}



}

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

#include <iostream>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
  int n, t, i, j;
  cin >> n;

  int c[n], s[n], f[n];
  for(i=0; i<n-1; i++){
    cin >> c[i] >> s[i] >> f[i];
  }
  c[n]=c[n-1];
  s[n]=s[n-1];
  f[n]=f[n-1];

  for(i=0; i<n-1; i++){
    t=0;
    for(j=i; j<n-1; j++){
      if(s[j]<t){
	t=s[j]+c[j]+ceil((t-s[j])*1.0/f[j])*f[j];
	//	cout << i << " " << j << "pattern1 " << t << endl;}
      else{
	t=s[j]+c[j];
	//	cout << i << " " << j << "pattern2 " << t << endl;}
    }
    cout << t << endl;
  }
    cout << 0;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: expected '}' before 'else'
   25 |       else{
      |       ^~~~
a.cc:22:17: note: to match this '{'
   22 |       if(s[j]<t){
      |                 ^
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<vector<int>>train(N - 1,vector<int>(3,0));
  for(int i=0;i<N-1;i++){
    for(int j=0;j<3;j++){
      cin >> train[i][j];
    }
  }
  
  for(int i=0;i<N;i++){
    int t = 0;
    for(int j=0;j<N-1;j++){
      if(t < train[j][1])
        t = train[j][1];
      else
        t = t + traun[j][2] - (t % train[j][2]);
      t += train[j][0];
    }
    
    cout << t << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'traun' was not declared in this scope; did you mean 'train'?
   21 |         t = t + traun[j][2] - (t % train[j][2]);
      |                 ^~~~~
      |                 train
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<vector<int>>train(N - 1,vector<int>(3,0));
  for(int i=0;i<N-1;i++){
    for(int j=0;j<3;j++){
      cin >> train[i][j];
    }
  }
  
  for(int i=0;i<N;i++){
    int t = 0;
    for(int j=0;j<N-1;j++){
      if(t < train[j][1])
        t = train[j][1];
      else
        t = t + traun[j][2] - (t % train[j][2]);
    }
    
    cout << t << endl;
  }
  
  return 0;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'traun' was not declared in this scope; did you mean 'train'?
   21 |         t = t + traun[j][2] - (t % train[j][2]);
      |                 ^~~~~
      |                 train
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> C(N-1);
  vector<int> S(N-1);
  vector<int> F(N-1);
  for(int i=0;i<N-1;i++){
    cin >> C[i] >> S[i] >>F[i]
  }
  for(int i=0;i<N;i++){
    int t=0;
    for(int j=0;j<N-1;j++){
      if(t<S[j]){
        t=S[j]+C[j];
      }
      else if(t%F[j]==0)t+=C[j];
      else{
        t=t+F[j]-t%F[j]+C[j];
      }
    }
    cout << t << endl;
  }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: error: expected ';' before '}' token
   11 |     cin >> C[i] >> S[i] >>F[i]
      |                               ^
      |                               ;
   12 |   }
      |   ~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> C(N-1);
  vector<int> S(N-1);
  vector<int> F(N-1);
  for(int i=0;i<N-1;i++){
    cin >> C[i] >> S[i] >>F[i]
  }
  for(int i=0;i<N;i++){
    int t=0;
    for(int j=0;j<N-1;j++){
      if(t<S[j]){
        t=S[j]+C[j];
      }
      else if(t%F[j]==0)t+=C[j]
      else{
        t=t+F[j]-t%F[j]+C[j];
      }
    }
    cout << t << endl;
  }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: error: expected ';' before '}' token
   11 |     cin >> C[i] >> S[i] >>F[i]
      |                               ^
      |                               ;
   12 |   }
      |   ~                            
a.cc:19:32: error: expected ';' before 'else'
   19 |       else if(t%F[j]==0)t+=C[j]
      |                                ^
      |                                ;
   20 |       else{
      |       ~~~~
Language: C++

# include < cstdio >
int N , C [500] , S [500] , F [500];
int main ()
{
scanf ("% d " ,& N );
for ( int i =0; i <N -1; i ++) scanf ("% d % d % d " ,& C [ i ] ,& S [ i ] ,& F [ i ]);
for ( int i =0; i < N ; i ++)
{
int t =0;
for ( int j = i ;j <N -1; j ++)
{
if (t < S [ j ]) t = S [ j ];
else if ( t % F [ j ]==0);
else t = t + F [ j ] - t % F [ j ];
t += C [ j ];
}
printf ("% d \ n " , t );
}
}

Compiler output:
a.cc:1:11: fatal error:  cstdio : No such file or directory
    1 | # include < cstdio >
      |           ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int N; cin >> N;
  int C[500],S[500],F[500];
  for(int i=0;i<N;i++){
    cin >> C[i] >> S[i] >> F[i];
  }
  for(int i=0;i<N;i++){
    int t=0;
    for(int j=i;j<N;j++){
      if(t<S[i])t=S[i];
      else if(t%F[i] == 0)
        else{t=t+t%F[i];}
      t += C[i];
    }
    cout << t << endl;
  }
}
      
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected primary-expression before 'else'
   15 |         else{t=t+t%F[i];}
      |         ^~~~
Language: C++

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

int main(){
  ll n,i,j;
  cin >> n;
  ll c[n],s[n],f[n];
  for(i=0;i<n;i++){
    cin >> c[n] >> s[n] >> f[n]
  }
    for(int i=1;i<n;++i){
    int t=0;
    for(int j=i;j<n;++j){
        if(t<s[j])t=s[j];
        else if(t%f[j]!=0)t+=f[j]-t%f[j];
        t+=c[j];
    }
    cout << t << endl;
  }
  cout << 0 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:32: error: expected ';' before '}' token
   10 |     cin >> c[n] >> s[n] >> f[n]
      |                                ^
      |                                ;
   11 |   }
      |   ~
Language: Java

import java.util.*;
 
class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int c[] = new int[n-1];
        int s[] = new int[n-1];
        int f[] = new int[n-1];
        for(int i=0; i<n-1; j++){
            c[i] = sc.nextInt();
            s[i] = sc.nextInt();
            f[i] = sc.nextInt();
        }
        for(int i=0; i<N; i++){
            int t = 0;
            for(int j=i; J<n-1; j++){
                if(t<s[j]) t=s[j];
                else if(t%f[j] == 0) ;
                else t = t+f[j] - t%F[j];
                t+=c[j];
            }
            System.out.println(t);
        }
        
    }
}

Compiler output:
Main.java:10: error: cannot find symbol
        for(int i=0; i<n-1; j++){
                            ^
  symbol:   variable j
  location: class Main
Main.java:15: error: cannot find symbol
        for(int i=0; i<N; i++){
                       ^
  symbol:   variable N
  location: class Main
Main.java:17: error: cannot find symbol
            for(int j=i; J<n-1; j++){
                         ^
  symbol:   variable J
  location: class Main
Main.java:20: error: cannot find symbol
                else t = t+f[j] - t%F[j];
                                    ^
  symbol:   variable F
  location: class Main
4 errors
Language: C++

int main(){
    int n;
    cin >> n;
    vector<vector<int>> v(n);
    for(int i = 0; i < n; i++){
        if(i == n - 1){
            for(int j = 0; j < 3; j++){
                v[i].push_back(0);
            }
        }else{
            for(int j = 0; j < 3; j++){
                int x;
                cin >> x;
                v[i].push_back(x);
            }
        }
    }
    vector<int> ans;
    for(int k = 0; k <= n - 2; k++){
        int t = v[k][0] + v[k][1];
        for(int i = k + 1; i <= n - 2; i++){
            if(t == v[i][1]){
                t += v[i][0];
            }
            else if(t < v[i][1]){
                t += (v[i][1] - t) + v[i][0];
            }
            else{
                t += (t - v[i][1]) % v[i][2] + v[i][0];
            }
        }
        ans.push_back(t);
    }
    for(int i = 0; i < n; i++){
        if(i == n - 1){
            cout << 0 << "\n";
        }else{
            cout << ans[i] << "\n";
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n;
      |     ^~~
a.cc:4:5: error: 'vector' was not declared in this scope
    4 |     vector<vector<int>> v(n);
      |     ^~~~~~
a.cc:4:19: error: expected primary-expression before 'int'
    4 |     vector<vector<int>> v(n);
      |                   ^~~
a.cc:8:17: error: 'v' was not declared in this scope
    8 |                 v[i].push_back(0);
      |                 ^
a.cc:14:17: error: 'v' was not declared in this scope
   14 |                 v[i].push_back(x);
      |                 ^
a.cc:18:12: error: expected primary-expression before 'int'
   18 |     vector<int> ans;
      |            ^~~
a.cc:20:17: error: 'v' was not declared in this scope
   20 |         int t = v[k][0] + v[k][1];
      |                 ^
a.cc:32:9: error: 'ans' was not declared in this scope
   32 |         ans.push_back(t);
      |         ^~~
a.cc:36:13: error: 'cout' was not declared in this scope
   36 |             cout << 0 << "\n";
      |             ^~~~
a.cc:38:13: error: 'cout' was not declared in this scope
   38 |             cout << ans[i] << "\n";
      |             ^~~~
a.cc:38:21: error: 'ans' was not declared in this scope
   38 |             cout << ans[i] << "\n";
      |                     ^~~
Language: C++

#include <iostrream>

int main(int argc, char** argv) {
  int a;
  std::cin >> a;
  
  for (int i=0; i<a-1; i++) {
    int x, y, z;
    std::cin >> x >> y >> z;
    int total = y;
    for (;;) {
      total += x;
      if (total % z == 0) { std::cout << total << std::endl; break; }
    }
  }
  std::cout << 0 << std::endl;
  return 0;
}

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

#include<iostream>
#include<vector>
#include<algorithm>
#include<stdio.h>
using namespace std;

vector<vector<long>> stat(501, vector<long>(4, 0));
int main(){
    int n;
    cin >> n ;

    for(int i=0; i<n-1; i++){
        cin >> stat[i][0] >> stat[i][1] >> stat[i][2];
    }
    for(int i=0; i<n-1; i++){
        long cost=stat[i][0]+stat[i][1];
        for(int j=i+1; j<n-1; j++){
            //cout << i << ", " << j << ", " << stat[j][2] << endl;
            if( cost <= stat[j][1] ) cost = stat[j][1]+stat[j][0];
            else if ( cost%stat[j][2]==0 ) cost += stat[j][0];
            else cost += stat[j][2-cost%stat[j][2] + stat[j][0];
        }
        cout << cost << endl;
    }
    cout << 0 << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:64: error: expected ']' before ';' token
   21 |             else cost += stat[j][2-cost%stat[j][2] + stat[j][0];
      |                                                                ^
      |                                                                ]
Language: C++

N = int( input() )
A = [ list( map(int, input().split()) ) for _ in range(N-1)]
# C[] = A[][0], S[] = A[][1], F[] = A[][2] 

def arrivalTime( time, loc ):
    if loc == N-1: return time
    if time <= A[loc][1]:
        return arrivalTime( A[loc][1]+A[loc][0], loc+1 )
    else:
        n = (time - A[loc][1] + (A[loc][2] - 1) ) // A[loc][2]
        return arrivalTime( A[loc][1]+A[loc][0] + n*A[loc][2], loc+1 )

for i in range(N-1):
    print( arrivalTime( A[i][1], i ) )
print( 0 )

Compiler output:
a.cc:3:3: error: invalid preprocessing directive #C
    3 | # C[] = A[][0], S[] = A[][1], F[] = A[][2]
      |   ^
a.cc:1:1: error: 'N' does not name a type
    1 | N = int( input() )
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<utility>
#include<functional>
#include<stack>
#include<queue>
#include<cmath>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
 
int main() {
	int n = 0;
	int c[500] = {}, s[500] = {}, f[500] = {};
	int ans = 0, tmp = 0;
 
	cin >> n;
	rep(i, n - 1) {
		cin >> c[i] >> s[i] >> f[i];
	}
 
	rep(i,n) {
 
		ans = s[i];
 
		for (int j = i; j < n - 1; j++) {
 
				if (ans < s[j]) {
					ans = s[j];
				}
				else {
					tmp = (ans - s[j]) / f[j];
					if ((ans - s[j]) % f[j] != 0) {
						ans = (tmp +　1) * f[j] + s[j];
					}
				}
			
			ans += c[j];
 
		}
 
		cout << ans << endl;
	}
 
	return 0;
 
}

Compiler output:
a.cc:38:61: error: extended character 　 is not valid in an identifier
   38 |                                                 ans = (tmp +　1) * f[j] + s[j];
      |                                                             ^
a.cc: In function 'int main()':
a.cc:38:61: error: '\U000030001' was not declared in this scope
   38 |                                                 ans = (tmp +　1) * f[j] + s[j];
      |                                                             ^~~
Language: C

#include <iostream>

using namespace std; 

int main(int argc, char** argv) {
	
	int SN[550]={0};
	int Snext[550]={0};
	int C[550]={0};
	int S[550]={0},F[550]={0};
	int i,j,k,n;
	cin>>n;

	for(i=1;i<=n-1;i++)
	{
		cin>>C[i]>>S[i]>>F[i];
	}
	for(i=1;i<=n-1;i++)
	{
		Snext[i]=C[i]+S[i];
	}
	SN[n]=0;
	SN[n-1]=Snext[n-1];
	for(i=n-2;i>=1;i--)
	{
		if(Snext[i]<=S[i+1]) SN[i]=SN[i+1];
		else 
		{
			SN[i]+=Snext[i];
			for(j=i+1;j<=n-1;j++)
			if(SN[i]>S[j]) 
				if(F[j]!=1)SN[i]+=(C[j]+0-SN[i]%F[j]); 
				else SN[i]+=C[j];
			else
			{
				SN[i]=SN[j];
				break;
			 } 
		}
	}
	for(i=1;i<=n;i++)
	cout<<SN[i]<<endl;
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <typeinfo>

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> C(N);
  vector<int> S(N);
  vector<int> F(N);
  for(int i=0;i<N-1;i++)  cin >> C.at(i) >> S.at(i) >> F.at(i);

  for(int i=0;i<N;i++){
    int ans=S.at(i);
    for(int j=i;j<N;j++){
      if(ans<S.at(j)) ans=S.at(j);
      else if(ans%F.at(j)==0);
      else  ans+=F.at(j)-t%F.at(j);
      ans+=C.at(j);
    }
    cout << ans << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: 't' was not declared in this scope
   30 |       else  ans+=F.at(j)-t%F.at(j);
      |                          ^
Language: C++

N = gets.to_i
ts = []
(N-1).times {
  c,s,f = gets.split.map(&:to_i)
  ts << 0
  (0...ts.size).each{ |i|
    t = ts[i]
    t = [t,s].max
    t += t % f == 0 ? 0 : (f - t % f)
    t += c
    ts[i] = t
  }
}
puts ts, 0

Compiler output:
a.cc:6:4: error: too many decimal points in number
    6 |   (0...ts.size).each{ |i|
      |    ^~~~~~~~~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N = gets.to_i
      | ^
a.cc:14:1: error: 'puts' does not name a type
   14 | puts ts, 0
      | ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <climits>
#include <sstream>

int N, C[500], S[500], F[500];

using namespace std;

int main(){

    scanf ("%d", &N);
    for(int i = 0; i < N - 1; i++) scanf("%d%d%d", &C[i], &S[i], &F[i]);

    for(int i = 0; i < N; i++){
        int t = 0;
        for(int j = i; j < N - 1; j++){
            if(t < S [j]) t = S[j];
            else if (t % F[j] == 0);
            else t = t + F[j] - t % F[j];
            t += C[j];
        }

    }

    printf ("%d\n", t);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:21: error: 't' was not declared in this scope; did you mean 'tm'?
   29 |     printf ("%d\n", t);
      |                     ^
      |                     tm