Language: C++

#include <iostream>
#include <vector>

using namespace std;

int lcm(int a, int t){
  int A = a, T = t;
  int gcd = 0;
  //euclid;
  if(a < t){
    int tmp = t;
    t = a;
    a = tmp;
  }
  int d = 0;
  int r = 0;
  while(r != 0){
    d = t / a;
    r = t % a;
    t = r;
    a = d;
  }
  gcd = a;
  return (A * T) / gcd;
}

int main(){
  int N;
  cin >> N
  vector<int> A(N), T(N), L(N);
  for(int i = 0; i < N; i++) cin >> A[i] >> T[i];
  for(int i = 0; i < N; i++) L[i] = lcm(A[i], T[i]);
  //A'[i] T'[i] = 最小公倍数のlcm[i]の倍数で、A[i-1], T[i-1] 以上で最小なA'[i] T'[i]
  for(int i = 1; i < N; i++){
    int preA = A[i-1], preT = T[i-1];
    for(int i = 1; i < 100; i++){
      int nowA = lcm[i] * i / T[i], nowT = lcm[i] * i / A[i];
      if(nowA < preA || nowT < preT) continue;
      else{
        A[i] = nowA, T[i] = nowT;
        break;
      }
    }
  }
  int ans = A[N-1] + T[N-1];
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:11: error: expected ';' before 'vector'
   29 |   cin >> N
      |           ^
      |           ;
   30 |   vector<int> A(N), T(N), L(N);
      |   ~~~~~~   
a.cc:31:37: error: 'A' was not declared in this scope
   31 |   for(int i = 0; i < N; i++) cin >> A[i] >> T[i];
      |                                     ^
a.cc:31:45: error: 'T' was not declared in this scope
   31 |   for(int i = 0; i < N; i++) cin >> A[i] >> T[i];
      |                                             ^
a.cc:32:30: error: 'L' was not declared in this scope
   32 |   for(int i = 0; i < N; i++) L[i] = lcm(A[i], T[i]);
      |                              ^
a.cc:32:41: error: 'A' was not declared in this scope
   32 |   for(int i = 0; i < N; i++) L[i] = lcm(A[i], T[i]);
      |                                         ^
a.cc:32:47: error: 'T' was not declared in this scope
   32 |   for(int i = 0; i < N; i++) L[i] = lcm(A[i], T[i]);
      |                                               ^
a.cc:35:16: error: 'A' was not declared in this scope
   35 |     int preA = A[i-1], preT = T[i-1];
      |                ^
a.cc:37:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   37 |       int nowA = lcm[i] * i / T[i], nowT = lcm[i] * i / A[i];
      |                       ^
a.cc:37:25: error: invalid operands of types 'int(int, int)' and 'int' to binary 'operator*'
   37 |       int nowA = lcm[i] * i / T[i], nowT = lcm[i] * i / A[i];
      |                  ~~~~~~ ^ ~
      |                       |   |
      |                       |   int
      |                       int(int, int)
a.cc:37:31: error: 'T' was not declared in this scope
   37 |       int nowA = lcm[i] * i / T[i], nowT = lcm[i] * i / A[i];
      |                               ^
a.cc:38:25: error: 'nowT' was not declared in this scope; did you mean 'nowA'?
   38 |       if(nowA < preA || nowT < preT) continue;
      |                         ^~~~
      |                         nowA
a.cc:38:32: error: 'preT' was not declared in this scope; did you mean 'preA'?
   38 |       if(nowA < preA || nowT < preT) continue;
      |                                ^~~~
      |                                preA
a.cc:45:13: error: 'A' was not declared in this scope
   45 |   int ans = A[N-1] + T[N-1];
      |             ^
a.cc:45:22: error: 'T' was not declared in this scope
   45 |   int ans = A[N-1] + T[N-1];
      |                      ^