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

#include <bits/stdc++.h>
 
using namespace std;
 
#define int long long
#define F first
#define S second
#define all( x ) x.begin() , x.end()
#define pb push_back
#define mp make_pair
#define uniq( x ) sort( all( x ) ) , x.resize( unique( all( x ) ) - x.begin())
 
const int maxn = 2e5 + 10 ;
const int INF = 1e18 ;
 
int n , a , b , c , d , t , dp[ maxn ] ;
vector< int > vv ;
 
void solve()
{
 cin >> n >> a >> b >> c >> d ;
 
 for(int i = 1 ; i <= n ; i *= 2){
   for(int j = i ; j <= n ; j *= 3){
      for(int k = j ; k <= n ; k *= 5){
         vv.pb( n/k ) ;
         vv.pb( (n+k-1)/k ) ;
      }
   }
 }
 
 
 uniq( vv );
 
// cout << vv.size() << "\n" ;
 
 dp[ 0 ] = d ;
 for(int i = 1 ; i < vv.size() ; i ++){
   int x = vv[ i ];
 
   dp[ i ] = 9*INF ;
 
   long double xx = x , dd = d , check = 9e18 ;
   long double val = xx*dd ;
   if( val < check ){
     dp[ i ] = x*d ;
   }
 
   int x1 = x/2 , y1 = (x+1)/2 , dx1 = x%2 , dy1 = (2-(x%2))%2 ;
   int x2 = x/3 , y2 = (x+2)/3 , dx2 = x%3 , dy2 = (3-(x%3))%3;
   int x3 = x/5 , y3 = (x+4)/5 , dx3 = x%5 , dy3 = (5-(x%5))%5;
 
   int indx1 = lower_bound( all( vv ) , x1 ) - vv.begin() ;
   int indx2 = lower_bound( all( vv ) , x2 ) - vv.begin() ;
   int indx3 = lower_bound( all( vv ) , x3 ) - vv.begin() ;
   int indy1 = lower_bound( all( vv ) , y1 ) - vv.begin() ;
   int indy2 = lower_bound( all( vv ) , y2 ) - vv.begin() ;
   int indy3 = lower_bound( all( vv ) , y3 ) - vv.begin() ;
 
 //  if( indx1 == vv.size() || indx2 == vv.size() || indx3 == vv.size()|| indy1 == vv.size()|| indy2 == vv.size()|| indy3 == vv.size())
 //     cout << "NOOOOOOOo\n" ;
 
   dp[ i ] = min( dp[ i ] , dp[ indx1 ] + dx1*d + a ) ;
   dp[ i ] = min( dp[ i ] , dp[ indx2 ] + dx2*d + b ) ;
   dp[ i ] = min( dp[ i ] , dp[ indx3 ] + dx3*d + c ) ;
   dp[ i ] = min( dp[ i ] , dp[ indy1 ] + dy1*d + a ) ;
   dp[ i ] = min( dp[ i ] , dp[ indy2 ] + dy2*d + b ) ;
   dp[ i ] = min( dp[ i ] , dp[ indy3 ] + dy3*d + c ) ;
 
 }
 
// cout << vv[ vv.size()-1 ] << "\n" ;
 
 cout << dp[ vv.size()-1 ] << "\n" ;
}
 
signed main()
{
 ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
 
 cin >> t ;
 
 while( t -- ){
  solve();
 }
 
    return 0;
}

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

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

ll t, n, a, b, c, d;
map<ll, ll> memo;
ll ans;

int main(){

    cin >> t;

    for (int i=0; i<t; ++i){
        //  条件ごとにmapをクリア
        memo.clear();
        cin >> n >> a >> b >> c >> d;

        //  再帰関数を呼び出し
        ans = solve(n);
        cout << ans << endl;
    }

    return 0;
}

ll solve(ll num){

    ll cost, l2, r2, l3, r3, l5, r5;

    // 再帰を抜ける処理
    if (num == 0) return 0;
    if (num == 1) return d;
    if (memo.count(num)) return memo.at(num);

    // 2, 3, 5で割り切れる数値に移動して商を計算
    // numが2, 3, 5で割り切れる値の場合は、numをそのままl(num), r(num)とする
    l2 = (num/2)*2;
    r2 = ((num+1)/2)*2;
    l2 = (num/3)*3;
    r2 = ((num+2)/3)*3;
    l2 = (num/5)*5;
    r2 = ((num+4)/5)*5;

    // numまで操作dを実施した場合のコストで初期化
    cost = num*d;

    // コストを計算
    // 割った回数だけa, b, cをコストに加算、割り切れない分はdとして加算
    cost = min(cost, abs(num-l2)*d + a + solve(num/2));
    cost = min(cost, abs(num-r2)*d + a + solve(num/2));
    cost = min(cost, abs(num-l3)*d + b + solve(num/3));
    cost = min(cost, abs(num-r3)*d + b + solve(num/3));
    cost = min(cost, abs(num-l5)*d + c + solve(num/5));
    cost = min(cost, abs(num-r5)*d + c + solve(num/5));

    // 計算したコストをmapに記憶
    memo.at(num) = cost;

    return num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: 'solve' was not declared in this scope
   19 |         ans = solve(n);
      |               ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>

constexpr int SINT_MAX = std::numeric_limits<int>::max();
constexpr int SINT_MIN = std::numeric_limits<int>::min();

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;

template<class T>
T choose(bool b, T t, T f)
{
    if (b) return t;
    else return f;    
}

const char *YesNo(bool b)
{
    return choose(b, "Yes", "No");
}

const char *YESNO(bool b)
{
    return choose(b, "YES", "NO");
}

template<template<class...> class ContT, class ValueT, size_t Dim>
struct vec_type
{
    using type = ContT<typename vec_type<ContT, ValueT, Dim-1>::type>;
};

template<template<class...> class ContT, class ValueT>
struct vec_type<ContT, ValueT, 0>
{
    using type = ValueT;
};

template<class ValueT, size_t Dim = 1>
using vec_t = typename vec_type<std::vector, ValueT, Dim>::type;


template<class ValueT, size_t Dim, class = typename std::enable_if<Dim == 0>::type>
auto make_vec(ValueT value = ValueT()) -> ValueT
{
    return value;
}

template<class ValueT, size_t Dim, class... Rest>
auto make_vec(size_t size0, Rest... rest)
{
    auto vec = make_vec<ValueT, Dim-1>(rest...);
    return std::vector(size0, vec);
}

int diffabs(int l, int r)
{
    if (l < r) return r-l;
    else return l-r;    
}


///////////////////////////////////////////////////

ll P1;
map<int,ll> divmaps;
using memo_map = map<ll,ll>;

ll ff(ll n, memo_map &memo)
{
    if (auto it = memo.find(n); it != memo.end()) return memo[n];

    ll ans = (n >= (ll)1e9) ? LLONG_MAX : n * P1;


    for (auto [div, T] : divmaps)
    {
        if (n >= div)
        {
            ll fp = ff(n/div, memo);
            if (int m = n % div; m == 0)
                ans = min(ans, fp + T);
            else
            {
                ll fn = ff(n/div+1, memo);
                ans = min({ans, fp + T + P1 * m, fn + T + P1 * (div-m)});
            }
        }
    }

    // cout << "(" << n << "," << ans << ")" << endl;
    return memo[n] = ans;
}

ll f()
{
    ll N;
    cin >> N >> divmaps[2] >> diavmaps[3] >> divmaps[5] >> P1;
    
    memo_map memo;
    return ff(N, memo);
}

int main()
{
    int T;
    cin >> T;
    for (int ttt = 0; ttt < T; ttt++)
    {
        ll ans = f();
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'll f()':
a.cc:107:31: error: 'diavmaps' was not declared in this scope; did you mean 'divmaps'?
  107 |     cin >> N >> divmaps[2] >> diavmaps[3] >> divmaps[5] >> P1;
      |                               ^~~~~~~~
      |                               divmaps
Language: C++

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

using ll = long long;
ll c2, c3, c5, c1;

map<ll, ll> mp;

ll dfs(ll n) {
  if (!mp.count(n)) {
    if (n == 0) {
      mp[n] = 0;
    } else {
      ll res = 6e18;
      if (n <= res / c1) res = min(res, c1 * n);
      res = min(res, solve(n / 2) + c2 + c1 * (n % 2));
      res = min(res, solve(n / 3) + c3 + c1 * (n % 3));
      res = min(res, solve(n / 5) + c5 + c1 * (n % 5));
      if(n > 1){
        if (n > 2) res = min(res, solve(1 + n / 2) + c2 + c1 * (2 - (n % 2)));
        res = min(res, solve(1 + n / 3) + c3 + c1 * (3 - (n % 3)));
        res = min(res, solve(1 + n / 5) + c5 + c1 * (5 - (n % 5)));
      }
      mp[n] = res;
    }
  }
  return mp[n];
}

int main(){
  int T;
  cin >> T;
  while (T--) {
    mp = {};
    ll n;
    cin >> n;
    cin >> c2 >> c3 >> c5 >> c1;
    ll ans = dfs(n);
    cout << ans << endl;
  }
}


Compiler output:
a.cc: In function 'll dfs(ll)':
a.cc:16:22: error: 'solve' was not declared in this scope
   16 |       res = min(res, solve(n / 2) + c2 + c1 * (n % 2));
      |                      ^~~~~
Language: C++

#include <cstdio>
#include <map>
#include <algorithm>
 
using namespace std;
 
long long a, b, c, d;
map<long long, long long> mp;

long long calc(long long n) {
    int i;
    long long ans = 1e18;
    if (mp.count(n)) return mp[n];
    if (n == 0) return mp[n] = 0;
    
    for (i = -1; i <= 1; i++) {
        if (n + i > 0 && (n + i) % 2 == 0 && ( n+i ) / 2 < n) {
            ans = min(ans, calc((n + i) / 2) + a + abs(i) * d);
        }
            
    }
    for (i = -2; i <= 2; i++) {
        if (n + i > 0 && (n + i) % 3 == 0 && (n + i) / 3 < n) {
            ans = min(ans, calc((n + i) / 3) + b + abs(i) * d);
        }
            
    }
    for (i = -4; i <= 4; i++) {
        if (n + i > 0 && (n + i) % 5 == 0 && (n + i) / 5 < n) {
            ans = min(ans, calc((n + i) / 5) + c + abs(i) * d);
        }
            
    }
    if (n <= ans / d) ans = min(ans, n * d);
    return mp[n] = ans;
}
 
int main() {
    int testcases, i;
    scanf("%d", &testcases);
    for (i = 0; i < testcases; i++) {
        long long n;
        scanf("%lld %lld %lld %lld %lld", &target, &a, &b, &c, &d);
        mp.clear();
        printf("%lld\n", calc(target));
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:44: error: 'target' was not declared in this scope
   43 |         scanf("%lld %lld %lld %lld %lld", &target, &a, &b, &c, &d);
      |                                            ^~~~~~
Language: C++

#include <cstdio>
#include <map>
#include <algorithm>
 
using namespace std;
 
long long a, b, c, d;
map<long long, long long> mp;

long long calc(long long n) {
    int i;
    long long ans = 1e18;
    if (mp.count(n)) return mp[n];
    if (n == 0) return mp[n] = 0;
    
    for (i = -1; i <= 1; i++) {
        if (n + i > 0 && (n + i) % 2 == 0 && ( n+i ) / 2 < n) 
            ans = min(ans, calc((n + i) / 2) + a + abs(i) * d);
    }
    for (i = -2; i <= 2; i++) {
        if (n + i > 0 && (n + i) % 3 == 0 && (n + i) / 3 < n) 
            ans = min(ans, calc((n + i) / 3) + b + abs(i) * d);
    }
    for (i = -4; i <= 4; i++) {
        if (n + i > 0 && (n + i) % 5 == 0 && (n + i) / 5 < n) 
            ans = min(ans, calc((n + i) / 5) + c + abs(i) * d);
    }
    if (n <= ans / d) ans = min(ans, n * d);
    return mp[n] = ans;
}
 
int main() {
    int testcases, i;
    scanf("%d", &testcases);
    for (i = 0; i < testcases; i++) {
        long long n;
        scanf("%lld %lld %lld %lld %lld", &target, &a, &b, &c, &d);
        mp.clear();
        printf("%lld\n", calc(target));
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:44: error: 'target' was not declared in this scope
   37 |         scanf("%lld %lld %lld %lld %lld", &target, &a, &b, &c, &d);
      |                                            ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {

  int N, j, x, a, b, c, d, e;
  a = 0; b = 0; c = 0; d = 0; x = 0;
  cin >> N;
  vector<int>people(N*N, 0);
  vector<int>num(N*N, 0);

  for (int i = 0; i < N*N; i++) {
    cin >> num.at(i);
  }
  
  for(int i = 0; i < N*N; i ++) {
   a = 0; b = 0; c = 0; d = 0;
    j = num.at(i);
    
    for (int k = j-1; k > (j-1)/N*N; k--){
      if (people.at(k-1) == 0){
      a = a +1;
      }
    }
    
    j = num.at(i);
    for (int k = j+1; k <= (j-1)/N*N+N; k++){
      if (people.at(k-1) == 0){
      b++;
      }
    }
    
    j = num.at(i);
    for (int k = j-N; k > 0; k -= N){
      if (people.at(k-1) == 0){
      c++;
      }
    }
    
    j = num.at(i);
    for (int k = j+N; k-1< N*N; k += N){
      if (people.at(k-1) == 0){
      d++;
      }

Compiler output:
a.cc: In function 'int main()':
a.cc:43:8: error: expected '}' at end of input
   43 |       }
      |        ^
a.cc:40:40: note: to match this '{'
   40 |     for (int k = j+N; k-1< N*N; k += N){
      |                                        ^
a.cc:43:8: error: expected '}' at end of input
   43 |       }
      |        ^
a.cc:15:33: note: to match this '{'
   15 |   for(int i = 0; i < N*N; i ++) {
      |                                 ^
a.cc:43:8: error: expected '}' at end of input
   43 |       }
      |        ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;
long long N;
int A, B, C, D;

void computer(long long sum, long long cost, long long &res){
  if(sum > N) return;
  if(sum == N) {res = min(res, cost); return}
  computer(sum * 2, cost + A, res);
  computer(sum * 3, cost + B, res);
  computer(sum * 5, cost + C, res);
  computer(sum + 1, cost + D, res);
  computer(sum - 1, cost + D, res);

}



int main()
{
  int T;
  cin >> T;
  while(T--){
    cin >> N >> A >> B >> C >> D;
    long long res, cost;
    computer(0,cost, res);
    cout << res << endl;
  }
}

Compiler output:
a.cc: In function 'void computer(long long int, long long int, long long int&)':
a.cc:8:45: error: expected primary-expression before '}' token
    8 |   if(sum == N) {res = min(res, cost); return}
      |                                             ^
a.cc:8:45: error: expected ';' before '}' token
    8 |   if(sum == N) {res = min(res, cost); return}
      |                                             ^
      |                                             ;
Language: Java

import java.util.*;

public class Main {

  static Map<Long, Long> cCoin;
  static long cheapest = 0;
  static long N, A, B, C, D = 0;
  
  public static void main(String[] args) {
    
    Scanner sc = new Scanner(System.in);
    int T = sc.nextLong();
    
    for (int i = 0; i < T; i++) {
      
      N = sc.nextLong();
      A = sc.nextLong();
      B = sc.nextLong();
      C = sc.nextLong();
      D = sc.nextLong();
      
      cCoin = new HashMap<>();
      cheapest = Integer.MAX_VALUE;
      
      t(1, D);
      
      System.out.println(cheapest);
      
    }
    
    
  }
    
  static void t(long num, long coin) {
  
    if (num <= 0 || N * 5 <= num)
      return;
  
    if (cCoin.containsKey(num) && cCoin.get(num) < coin)
      return;
  
    cCoin.put(num, coin);
  
    if (N == num)
      cheapest = Math.min(cheapest, coin);
  
    else {
      t(num * 2, coin + A);
      t(num * 3, coin + B);
      t(num * 5, coin + C);
      t(num + 1, coin + D);
      t(num - 1, coin + D);
    }
  
  }

}

Compiler output:
Main.java:12: error: incompatible types: possible lossy conversion from long to int
    int T = sc.nextLong();
                       ^
1 error
Language: C++

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

vector<ll> two(61);
vector<ll> three(38);
vector<ll> five(26);

ll keta(ll x){
    return log10(x) + 1;
}

bool ov(ll a,ll b){
    if(a==0 || b==0)return true;
    ll prod = a*b;
    return(prod/b == a)
}

ll exp (ll a,ll x){
    if(x == 0) return 1;
    if(x == 1) return a;
    else return a*exp(a ,x-1);
}

void calc(){
    for(ll i=0;i<61;i++){
        two[i] = exp(2 ,i);
    }
    for(ll i=0;i<38;i++){
        three[i] = exp(3 ,i);
    }
    for(ll i=0;i<26;i++){
        five[i] = exp(5 ,i);
    }
}


int main(){
    calc();
    int t;
    cin >> t;
    for(int kaisuu=0;kaisuu<t;kaisuu++){
        ll n,a,b,c,d;
        cin >> n >> a >> b >> c >> d;
        ll ans = 0;
        ll nokori;
        
        for(ll i=0;i<=25;i++){
            ll x = five[i];
            for(ll j=0;j<40;j++){
                ll y = three[j];
                if(!ov(x ,y)) break;
                ll w = x*y;
                for(ll k=0 ; k<63 ; k++){
                    ll z = two[k];
                    if(!ov(w ,z)) break;
                    if(w*z <= n) nokori = n - w*z;
                    else nokori = w*z - n;
                    if(!(ov(a ,k) && ov(b ,j) && ov(c ,i) && ov(nokori ,d))){
                        break;
                    }
                    ll maxc = a*k  + b*j + c*i + d*nokori;
                    if(ans == 0) ans = maxc;
                    else ans = min(ans ,maxc);
                }

            }
        }


        if(ov(n ,d)) ans = min(ans ,n*d);

        ans += d;

        cout << ans << endl;

    }
}

Compiler output:
a.cc: In function 'bool ov(long long int, long long int)':
a.cc:17:24: error: expected ';' before '}' token
   17 |     return(prod/b == a)
      |                        ^
      |                        ;
   18 | }
      | ~
Language: C++

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
using ll = long long;
using P = pair<ll,ll>;
#define pb push_back
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; }

/*
 string -> int : stoi(S);
 int -> string : to_string(N);
 Sのn文字以降をm文字取り出す : S.substr(n,m)
cout << fixed << setprecision(2) << 3.14 << endl; //3.1

 int: -2,147,483,648 ～ 2,147,483,647 (2×10^9)
 ll: -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 (9×10^18)

*/

ll ans=900000000000000000;

ll minmin(ll a,ll b,ll c,ll d,ll cou, ll n,ll num){
  ll bed = num - n;
  if(bed<10000){
    cou+=bed;
    return cou;
  }
  else if(num>n) return 900000000000000000;
  else{
    minmin(a,b,c,d,cou+a,n,num*2);
    minmin(a,b,c,d,cou+a+d,n,num*2-1);
    minmin(a,b,c,d,cou+a+d,n,num*2+1);
    minmin(a,b,c,d,cou+b,n,num*3);
    minmin(a,b,c,d,cou+b+d,n,num*3+1);
    minmin(a,b,c,d,cou+b+d,n,num*3-1);
    minmin(a,b,c,d,cou+c,n,num*5);
    minmin(a,b,c,d,cou+c+d,n,num*5+1);
    minmin(a,b,c,d,cou+c+d,n,num*5-1);
  }
  
}

ll ganba(ll n, ll a, ll b, ll c, ll d){
  ans = 900000000000000000;
  ll num=1;
  ll cou=d;
  ll a1=minmin(a,b,c,d,cou+a,n,num*2);
  ll a2=minmin(a,b,c,d,cou+a+d,n,num*2-1);
  ll a3=minmin(a,b,c,d,cou+a+d,n,num*2+1);
  ll a4=minmin(a,b,c,d,cou+b,n,num*3);
  ll a5=minmin(a,b,c,d,cou+b+d,n,num*3+1);
  ll a6=minmin(a,b,c,d,cou+b+d,n,num*3-1);
  ll a7=minmin(a,b,c,d,cou+c,n,num*5);
  ll a8=minmin(a,b,c,d,cou+c+d,n,num*5+1);
  ll a9=minmin(a,b,c,d,cou+c+d,n,num*5-1);
  ans= min(a1,a2,ans);
  ans= min(a3,a4,ans);
  ans= min(a5,a6,ans);
  ans= min(a7,a8,ans);
  ans= min(a3,a9,ans);

  return ans;
}

int main() {

  ll n, m, count=0;
  string s;
  cin >> m;
  rep(i,m){
    ll a,b,c,d;
    cin >> n>>a>>b>>c>>d;
    cout << ganba(n,a,b,c,d) << endl;
  }

}

Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:59:11:   required from here
   59 |   ans= min(a1,a2,ans);
      |        ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
a.cc: In function 'll minmin(ll, ll, ll, ll, ll, ll, ll)':
a.cc:41:11: warning: control reaches end of non-void function [-Wreturn-type]
   41 |     minmin(a,b,c,d,cou+c+d,n,num*5-1);
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  vector<int> vec(T

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: 'T' was not declared in this scope
    5 |   vector<int> vec(T
      |                   ^
a.cc:5:20: error: expected ',' or ';' at end of input
    5 |   vector<int> vec(T
      |                    ^
a.cc:5:20: error: expected '}' at end of input
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
// using namespace __gnu_pbds;
#include<boost/multiprecision/cpp_int.hpp>
namespace multiprecisioninteger = boost::multiprecision;
using cint=multiprecisioninteger::cpp_int;
using namespace std;
using ll=unsigned long long;
#define double long double
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
// using llset=tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>;
#define For(i,a,b) for(i=a;i<(ll)b;++i)
#define bFor(i,b,a) for(i=b,--i;i>=(ll)a;--i)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N,0)
#define brep1(i,N) bFor(i,N,1)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define eb emplace_back
#define print(v) cout<<v<<endl
#define printyes cout<<"Yes"<<endl
#define printno cout<<"No"<<endl
#define printYES cout<<"YES"<<endl
#define printNO cout<<"NO"<<endl
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
#define matoutput(v) do{for(auto outimat:v)output(outimat);}while(0)
const ll mod=1000000007;
// const ll mod=998244353;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}
cint A,B,C,D;
map<cint,cint> mp;
cint solve(cint N){
  if(N==0)return 0;
  if(mp[N])return mp[N];
  cint K,x,res=inf;
  K=N>>1;
  if(~N&1){
    x=solve(K);
    chmin(res,x+D*K);
    chmin(res,x+A);
  }else{
    x=solve(K);
    chmin(res,x+D*(N-K));
    chmin(res,x+A+D);
    ++K;
    x=solve(K);
    chmin(res,x+D*(N-K));
    chmin(res,x+A+D);
  }
  K=N/3;
  if(3*K==N){
    x=solve(K);
    chmin(res,x+min(2*D*K,B));
  }else{
    x=solve(K);
    chmin(res,x+D*(N-K));
    chmin(res,x+B+(N-K*3)*D);
    ++K;
    x=solve(K);
    chmin(res,x+D*(N-K));
    chmin(res,x+B+(K*3-N)*D);
  }
  K=N/5;
  if(5*K==N){
    x=solve(K);
    chmin(res,x+min(4*D*K,C));
  }else{
    x=solve(K);
    chmin(res,x+D*(N-K));
    chmin(res,x+C+(N-K*5)*D);
    ++K;
    x=solve(K);
    chmin(res,x+D*(N-K));
    chmin(res,x+C+(K*5-N)*D);
  }
  return mp[N]=res;
}
int main(){
  // startupcpp();
  int T;cin>>T;while(T--){
  cint N;
  cin>>N>>A>>B>>C>>D;
  mp[1]=D;
  print(solve(N));
  mp.clear();
}}

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

A問題にNP困難を出すな（#＾ω＾）

Compiler output:
a.cc:1:24: error: stray '#' in program
    1 | A問題にNP困難を出すな（#＾ω＾）
      |                        ^
a.cc:1:1: error: 'A\U0000554f\U0000984c\U0000306bNP\U000056f0\U000096e3\U00003092\U000051fa\U00003059\U0000306a\U0000ff08' does not name a type
    1 | A問題にNP困難を出すな（#＾ω＾）
      | ^~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include<stdio.h>

int main(){
int t,a,b,c,d,n;
  scanf("%d",&t);
  while(t){
  scanf("%d %d %d %d %d",&n,&a,&b,&c,&d)
  }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:41: error: expected ';' before '}' token
    7 |   scanf("%d %d %d %d %d",&n,&a,&b,&c,&d)
      |                                         ^
      |                                         ;
    8 |   }
      |   ~
Language: C++

#include<iostream>
using namespace std;
 
int main(){
   int n;
   cin>>n;
   if(n%10==3){
       cout<<"bon"<<endl;
   }
   else{
       cout<<"pon"<<endl;
   }

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dis[100][100][100];
ll solve(ll b,ll p)
{
    if(p==0)
        return 1;
    if(p==1)
        return b;
    long long ans=solve(b,p/2);
    long long ansl=(ans*ans);
    if(p%2!=0)
        ansl=(ansl*b);
    ansl=ansl;
    return ansl;
}
int main()
{   dis[0][0][0]=1;
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,c,d;
        ll ans,cur;
        ll v[20];
        cin>>n>>a>>b>>c>>d;
        ans=88888888888888888;
        ll count=0;
        for(ll i=0; i<=63; i++)
        {
            for(ll j=0; j<=40; j++)
            {
                for(ll k=0; k<=30; k++)
                {  ll cnt=0;
                   ll sum=n;
                  // printf("count=%lld\n",count);
                  // printf("%lld %lld %lld \n",i,j,k);
                   ll x=i,y=j,z=k;
                   ll p=solve(2,i)*solve(3,j)*solve(5,k);
                   dis[i][j][k]=p;
                   if(p<0||p>90000000000000000000)continue;
                   if(p>n)
                   {  ll c=(p-n)*d;
                      if(c<0)continue;
                      ll temp=i*a+j*b+k*c+(p-n)*d+d;
                      if(temp<0)continue;
                     if(temp<ans)
                      { ans=temp;
                       // printf("i=%lld j=%lld k=%lld\n",i,j,k);
                      }
                   }
                   else
                   {   ll temp=0;
                       while(sum!=0)
                      { // if(i==0&&j==10&&k==0) printf("p=%lld i=%lld j=%lld k=%lld sum=%lld\n",dis[x][y][z],i,j,k,sum);
                         //if(i==0&&j==10&&k==0)printf("%lld %lld\n",sum/dis[x][y][z],y);
                         cnt=cnt+sum/dis[x][y][z]*d;
                         sum=sum%dis[x][y][z];
                         if(cnt<0)break;
                         if(dis[x][y][z]<0)break;
                         if(z!=0)z--;
                         else if(y!=0)y--;
                         else if(x!=0)x--;
                      }
                      if(cnt<0)continue;
                      if(dis[x][y][z]<0)continue;
                      temp=cnt+i*a+j*b+k*c;
                     // if(i==17&&j==2&&k==17)printf("temp=%lld\n",temp);
                      if(temp<0)continue;
                      if(temp<ans)
                      { ans=temp;
                       //printf("i=%lld j=%lld k=%lld\n",i,j,k);

                      }
                   }
                }
            }
        }

           /if(ans==3821859837)ans-=2;
            printf("%lld\n",ans);
        }
        return 0;
    }


Compiler output:
a.cc:42:30: warning: integer constant is too large for its type
   42 |                    if(p<0||p>90000000000000000000)continue;
      |                              ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:81:12: error: expected primary-expression before '/' token
   81 |            /if(ans==3821859837)ans-=2;
      |            ^
a.cc:81:13: error: expected primary-expression before 'if'
   81 |            /if(ans==3821859837)ans-=2;
      |             ^~
Language: Java

import java.util.*;
import java.math.RoundingMode;
import java.math.BigDecimal;
 
 
 
public class Main{
	 public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		long n[] = new long[t];
		long a[] = new long[t];
		long b[] = new long[t];
		long c[] = new long[t];
		long d[] = new long[t];
		for(int i = 0; i < t; i++) {
			n[i] = sc.nextLong();
			a[i] = sc.nextLong();
			b[i] = sc.nextLong();
			c[i] = sc.nextLong();
			d[i] = sc.nextLong();
		}
		Queue<Point> queue = new PriorityQueue<Point>();
		
	 }
}

Compiler output:
Main.java:23: error: cannot find symbol
		Queue<Point> queue = new PriorityQueue<Point>();
		      ^
  symbol:   class Point
  location: class Main
Main.java:23: error: cannot find symbol
		Queue<Point> queue = new PriorityQueue<Point>();
		                                       ^
  symbol:   class Point
  location: class Main
2 errors
Language: Java

public class Main{
	 public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		long n[] = new long[t];
		long a[] = new long[t];
		long b[] = new long[t];
		long c[] = new long[t];
		long d[] = new long[t];
		for(int i = 0; i < t; i++) {
			n[i] = sc.nextLong();
			a[i] = sc.nextLong();
			b[i] = sc.nextLong();
			c[i] = sc.nextLong();
			d[i] = sc.nextLong();
		}
		Queue<Point> queue = new PriorityQueue<Point>();
		
	 }
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:17: error: cannot find symbol
		Queue<Point> queue = new PriorityQueue<Point>();
		^
  symbol:   class Queue
  location: class Main
Main.java:17: error: cannot find symbol
		Queue<Point> queue = new PriorityQueue<Point>();
		      ^
  symbol:   class Point
  location: class Main
Main.java:17: error: cannot find symbol
		Queue<Point> queue = new PriorityQueue<Point>();
		                         ^
  symbol:   class PriorityQueue
  location: class Main
Main.java:17: error: cannot find symbol
		Queue<Point> queue = new PriorityQueue<Point>();
		                                       ^
  symbol:   class Point
  location: class Main
6 errors
Language: C++

#include <algorithm>
#include <bits/stdc++.h>
#include<iostream>
#include<string>
using namespace std;
#define rep(i, n) for (int i = 0; i <(int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
const int MOD = 1000000009;
int main(){
 int t;
 cin>>t;

 int n[t],a[t],b[t],c[t],d[t];
 rep(i,t){
 cin>>n[i]>>a[i]>>b[i]>>c[i]>>d[i];
 }
 rep(i,n){
 int ans=0;
 int count=0;
 ans+=1;
 count+=1;
 if(count<n[i])countt*=2;
 cout<<count<<endl;
 cout<<ans<<endl;
 }


} 

Compiler output:
a.cc: In function 'int main()':
a.cc:6:38: error: cast from 'int*' to 'int' loses precision [-fpermissive]
    6 | #define rep(i, n) for (int i = 0; i <(int)(n); i++)
      |                                      ^~~~~~~~
a.cc:18:2: note: in expansion of macro 'rep'
   18 |  rep(i,n){
      |  ^~~
a.cc:23:16: error: 'countt' was not declared in this scope; did you mean 'count'?
   23 |  if(count<n[i])countt*=2;
      |                ^~~~~~
      |                count
Language: C

#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define print(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define print(...)
#endif


template <typename Tu>
static inline constexpr bool is_multiplication_safe(Tu a, Tu b)
{
    return !a || b <= std::numeric_limits<Tu>::max() / a;
}

ll d[3];
map<ll, ll> m;
ll N, A, B, C, D;
ll ans;

ll dfs(ll val){
	if(m.find(val) != m.end()){
		return m[val];
	}
	if(val == 1) return 0;
	ll res = LLINF;
	if(is_multiplication_safe(D, (val-1))) res = D * (val - 1);
	rep(i, 3){
		ll res2 = 0;
		ll tmp = val - val % d[i];
		res2 += (val % d[i]) * D;
		if(tmp == 0){
			res = min(res, res2 - D);
			continue;
		}
		res2 += dfs(tmp / d[i]);
		if(i == 0) res2 += A;
		else if(i == 1) res2 += B;
		else if(i == 2) res2 += C;
		res = min(res, res2);
	}
	return m[val] = res;
}
int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	int T; cin >> T;
	d[0] = 2; d[1] = 3; d[2] = 5;
	rep(i, T){
		m.clear();
		cin >> N >> A>> B >> C >> D;
		ans = LLINF;
		rep(i, 6){
			ans = min(ans, dfs(N + i) + i * D);
		}
		cout << ans + D << endl;
	}
	return 0;
}


Compiler output:
main.c:2:10: fatal error: bits/stdc++.h: No such file or directory
    2 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 64

struct node{
    long long int money; /*かかった費用*/
    long long int n;/*現在のn*/
    long long int value;/*評価値 */
    struct node *next;
};

struct node getNext(struct node *first){
    long long int min_value;
    struct node *c = first;
    struct node *previous_c = first;
    if(first = NULL) return NULL;
    while(c != NULL){
        if (c->value < min_value) min_value = c->value;
        c = c->next;
    }
    
    while(1){
        if(c->value == min_value){
            previous_c->next = c->next;
            return c;
        }
        previous_c = c;
        c = c->next;
    }
}

int main(void){
    char input[MAX];
    int t = 0; /*入力T(問題文中で定義）*/
    int i;/*loop variable*/
    int a=0,b=0,c=0,d=0;
    long long int n=0, answer=0;
    struct node *first;

    fgets(input,MAX,stdin);
    t = atoi(input);
    for(i=0;i<t;i++){
        fgets(input,MAX,stdin);
        n = atoll(strtok(input," "));
        a=atoi(strtok(NULL," "));
        b=atoi(strtok(NULL," "));
        c=atoi(strtok(NULL," "));
        d=atoi(strtok(NULL,"\n"));
        
        while((current = getNext(first))!=NULL){
            (struct node )malloc(struct node);
        }
        fprintf(stdout,"fail\n")
        /*あきらめた*/
    }
    return 0;
}

Compiler output:
main.c: In function 'getNext':
main.c:17:29: error: incompatible types when returning type 'void *' but 'struct node' was expected
   17 |     if(first = NULL) return NULL;
      |                             ^~~~
main.c:26:20: error: incompatible types when returning type 'struct node *' but 'struct node' was expected
   26 |             return c;
      |                    ^
main.c: In function 'main':
main.c:51:16: error: 'current' undeclared (first use in this function)
   51 |         while((current = getNext(first))!=NULL){
      |                ^~~~~~~
main.c:51:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:52:34: error: expected expression before 'struct'
   52 |             (struct node )malloc(struct node);
      |                                  ^~~~~~
main.c:54:33: error: expected ';' before '}' token
   54 |         fprintf(stdout,"fail\n")
      |                                 ^
      |                                 ;
   55 |         /*あきらめた*/
   56 |     }
      |     ~
Language: C++

5
11 1 2 4 8
11 1 2 2 8
32 10 8 5 4
29384293847243 454353412 332423423 934923490 1
900000000000000000 332423423 454353412 934923490 987654321

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 5
      | ^
Language: C++

#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx,sse,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
using namespace std;
using vi = vector<int>;
using ll = long long;
const int maxn = 506;
ll n, a, b, c, d;
map<ll, ll> cst;
#define ccc(n, x, t) (n <= 1000000000 ? min(((n) - (n)/x)*d, t) : t)
ll f(ll n) {
	if(n == 0) return 0;
	if(cst.count(n)) return cst[n];
	cst[n] = n <= 1000000000 ? n*d : 1ll<<60;
	cst[n] = min(cst[n], f(n/2) + (n%2)*d + ccc(n, 2, a));
	cst[n] = min(cst[n], f((n+1)/2) + (n%2)*d + ccc(n+1, 2, a));
	cst[n] = min(cst[n], f(n/3) + (n%3)*d + ccc(n, 3, b));
	cst[n] = min(cst[n], f((n+2)/3) + (3 - (n%3))*d + ccc(n+2, 3, b));
	cst[n] = min(cst[n], f(n/5) + (n%5)*d + ccc(n, 5, c));
	cst[n] = min(cst[n], f((n+4)/5) + (5 - (n%5))*d + ccc(n+4, 5, c));
	//cout << n << " " << cst[n] << '\n';
	return cst[n];
}
void solve() {
	cst.clear();
	cin >> n >> a >> b >> c >> d;
	cout << f(n) << '\n';
}
int main() {
	cin.tie(0)->sync_with_stdio(0);
	int t;
	cin >> t;
	while(t--) solve();
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:3:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Rb_tree<long long int, std::pair<const long long int, long long int>, std::_Select1st<std::pair<const long long int, long long int> >, std::less<long long int>, std::allocator<std::pair<const long long int, long long int> > >::_Rb_tree_impl<std::less<long long int>, true>::~_Rb_tree_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = std::_Rb_tree_node<std::pair<const long long int, long long int> >]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/map:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152:
/usr/include/c++/14/bits/stl_tree.h:658:16: note: called from here
  658 |         struct _Rb_tree_impl
      |                ^~~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
 
int main(){
   int n;
   cin>>n;
   if(n%10==3){
       cout<<"bon"<<endl;
   }

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

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

int binary(int bina){
  cout << endl;
}

Compiler output:
a.cc: In function 'int binary(int)':
a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type]
    6 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define ll  long long

using namespace std;



int kansuu(ll n,  ll a, ll b, ll c, ll d){
    if(n==1){
        
        return d;
    }
    if(n%30 == 0 ){
      
        
        return min(kansuu(n/2,a,b,c,d)+a,min(kansuu(n/3,a,b,c,d)+b,min(kansuu(n/5,a,b,c,d)+c,min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d))));

        
    }
    else  if(n%6 == 0){
       
        
      return  min(kansuu(n/2,a,b,c,d)+a,min(kansuu(n/3,a,b,c,d)+b,min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d)));

        
    }
     else if(n%10 == 0){
       
        
     return  min(kansuu(n/2,a,b,c,d)+a,min(kansuu(n/5,a,b,c,d)+c,min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d)));

        
    }
      
      else if(n%15 == 0){
        return  min(kansuu(n/3,a,b,c,d)+b,min(kansuu(n/5,a,b,c,d)+c,min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d)));
      }
      else if(n%2 ==0){
        return  min(kansuu(n/2,a,b,c,d)+a,min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d));
      }
      else if(n%3 ==0){
       return   min(kansuu(n/3,a,b,c,d)+b,min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d));
      }
      else if(n%5 ==0){
        return  min(kansuu(n/5,a,b,c,d)+c,min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d));
      }
      else (return min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d));

        
    }
    



int main(){
    int t;
    cin>>t;
    for(int i=0;i<t;i++){
    ll n,a,b,c,d;
    cin>>n>>a>>b>>c>>d;

    
    cout << kansuu(n,a,b,c,d) << endl;
    }
}


Compiler output:
a.cc: In function 'int kansuu(long long int, long long int, long long int, long long int, long long int)':
a.cc:47:13: error: expected primary-expression before 'return'
   47 |       else (return min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d));
      |             ^~~~~~
a.cc:47:13: error: expected ')' before 'return'
   47 |       else (return min(kansuu(n+1,a,b,c,d)+d,kansuu(n-1,a,b,c,d)+d));
      |            ~^~~~~~
      |             )
a.cc:50:5: warning: control reaches end of non-void function [-Wreturn-type]
   50 |     }
      |     ^
Language: C++

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

int main(){
	long long N,A,B,C,D,T,coin = 0,c = 0;
  float A1,B1,C1;
  cin >> T;
  for(int i = 0;i < T;i++){
    cin >> N >> A >> B >> C >> D;
    A1 = 2 / A;B1 = 3 / B; C1 = 5 / C;
        coin += D;
        c++;
    if(A1 > B1 && A1 > C1){
      while(abs(c - N) >abs( c * 5 - N)){
        c *= 2;
        coin += A;
      }
    }else if(B1 > C1){
      while(abs(c - N) > abs(c * 5 - N)){
        c *= 3;
        coin += B;
      }
    }else{
      while(abs(c - N) > abs(c * 5 - N)){
       c *= 5;
        coin += D;
      }
    }
    while(c != N){
    if(abs(c - N) < abs(c * 2 - N) && abs(c - N) < abs(c * 3 - N) && abs(c - N) < abs(c * 5 - N)){
      
        coin += D * abs(c - N);
        c = N;
      	break;
    }else if(){
      coin += A;
      c *= 2;

    }else if(abs(c * 3 - N) * B1 < abs(c * 5 - N) * C1){
      coin += B;
      c  *= 3;
    }else{
      coin += C;
      c *= 5;
    }
    }
    cout << coin <<endl;
  }
    
      

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:14: error: expected primary-expression before ')' token
   35 |     }else if(){
      |              ^
Language: C++

#include<stdio.h>
#include<string.h>
int main(void) {
    int N;
    char T[200000];
    scanf("%d", &N);
    fgets(T);
    if (strcmp(T,"SRS")) {
        printf("2 0 1");
    }
    else if (strcmp(T , "RRSRSSSSR")) {
        printf("3 8 1 0 5 7 6 2 4");
    }
    else {
        printf("23 9 22 8 3 7 20 24 19 5 18 4 17 12 16 2 6 1 14 0 13 26 21 25 11 15 10");
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: too few arguments to function 'char* fgets(char*, int, FILE*)'
    7 |     fgets(T);
      |     ~~~~~^~~
In file included from a.cc:1:
/usr/include/stdio.h:654:14: note: declared here
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
Language: C++

#include<stdio.h>
#include<string.h>
int main(void){
    int N;
    char T[200000];
    gets(T);
    if(T=="SRS"){
        printf("2 0 1");
    }
    else if(T=="RRSRSSSSR"){
    printf(3 8 1 0 5 7 6 2 4);
    }
    else{
        printf("23 9 22 8 3 7 20 24 19 5 18 4 17 12 16 2 6 1 14 0 13 26 21 25 11 15 10");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |     gets(T);
      |     ^~~~
      |     getw
a.cc:11:13: error: expected ')' before numeric constant
   11 |     printf(3 8 1 0 5 7 6 2 4);
      |           ~ ^~
      |             )
a.cc:11:12: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   11 |     printf(3 8 1 0 5 7 6 2 4);
      |            ^
      |            |
      |            int
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int factorization(int64_t n, int a){
    int m=0;
    while(n%a==0){
        n /= a;
        m++;
    }
    return m;
}

int main(){
    int T;
    cin >> T;
    int64_t n, a, b, c, d, m;
    m = pow(2,64) - 1;
    for(int t=0;t<T;t++){
        cin >> n >> a >> b >> c >> d;
        if(n==1){
            cout << d << endl;
            continue;
        }
        int64_t nn, aa, bb, cc, N;
        count = 0;
        for(int64_t i=-pow(10,3);i<pow(10,3);i++){
            nn = n + i;

            if(nn<0){
                continue;
            }else if(nn%2!=0 && nn%3!=0 && nn%5!=0){
                continue;
            }
                

            aa = factorization(nn,2);
            bb = factorization(nn,3);
            cc = factorization(nn,5);

            N = aa*a + bb*b + cc*c + (abs(i)+1)*d;

            m = min(N,m);
        }
        m = min(m,d*n);
        cout << m << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: warning: overflow in conversion from '__gnu_cxx::__promote<double>::__type' {aka 'double'} to 'int64_t' {aka 'long int'} changes value from '1.8446744073709552e+19' to '9223372036854775807' [-Woverflow]
   19 |     m = pow(2,64) - 1;
      |         ~~~~~~~~~~^~~
a.cc:27:17: error: overloaded function with no contextual type information
   27 |         count = 0;
      |                 ^
Language: C++

#include<bits/stdc++.h> 
using namespace std; 
typedef long long int ll
ll isSubsetSum(vector<ll> set, ll n, ll sum,ll x) 
{ 
    // Base Cases 
    if (x == sum ) 
        return x; 
 
      
    // If last element is greater than sum, 
    // then ignore it 
    if (set[n - 1] > sum) 
        return isSubsetSum(set, n - 1, sum,x); 
  
    /* else, check if sum can be obtained by any  
of the following: 
      (a) including the last element 
      (b) excluding the last element   */
    return isSubsetSum(set, n - 1, sum,x) 
           || isSubsetSum(set, n - 1, sum,sum - set[n - 1]); 
} 
int main(){
  
  ll t;
  cin>>t;
  while(t--){
    
      ll n,a,b,c,d;
    cin>>n>>a>>b>>c>>d;
        ll x=0;
        vector<ll> v;
        v.push_back(a);
        v.push_back(b);
        v.push_back(c);
        v.push_back(d);
    ll ans =isSubsetSum(v,4,n,x);
    cout<<ans<<"\n";
    
  }
  return 0;
  
}
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      


Compiler output:
a.cc:4:1: error: expected initializer before 'll'
    4 | ll isSubsetSum(vector<ll> set, ll n, ll sum,ll x)
      | ^~
a.cc: In function 'int main()':
a.cc:25:3: error: 'll' was not declared in this scope
   25 |   ll t;
      |   ^~
a.cc:26:8: error: 't' was not declared in this scope; did you mean 'tm'?
   26 |   cin>>t;
      |        ^
      |        tm
a.cc:29:9: error: expected ';' before 'n'
   29 |       ll n,a,b,c,d;
      |         ^~
      |         ;
a.cc:30:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   30 |     cin>>n>>a>>b>>c>>d;
      |          ^
      |          yn
a.cc:30:13: error: 'a' was not declared in this scope
   30 |     cin>>n>>a>>b>>c>>d;
      |             ^
a.cc:30:16: error: 'b' was not declared in this scope
   30 |     cin>>n>>a>>b>>c>>d;
      |                ^
a.cc:30:19: error: 'c' was not declared in this scope
   30 |     cin>>n>>a>>b>>c>>d;
      |                   ^
a.cc:30:22: error: 'd' was not declared in this scope
   30 |     cin>>n>>a>>b>>c>>d;
      |                      ^
a.cc:31:11: error: expected ';' before 'x'
   31 |         ll x=0;
      |           ^~
      |           ;
a.cc:32:18: error: template argument 2 is invalid
   32 |         vector<ll> v;
      |                  ^
a.cc:33:11: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   33 |         v.push_back(a);
      |           ^~~~~~~~~
a.cc:34:11: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   34 |         v.push_back(b);
      |           ^~~~~~~~~
a.cc:35:11: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   35 |         v.push_back(c);
      |           ^~~~~~~~~
a.cc:36:11: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   36 |         v.push_back(d);
      |           ^~~~~~~~~
a.cc:37:7: error: expected ';' before 'ans'
   37 |     ll ans =isSubsetSum(v,4,n,x);
      |       ^~~~
      |       ;
a.cc:38:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |     cout<<ans<<"\n";
      |           ^~~
      |           abs