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

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;
#define INF 99999
#define _GLIBCXX_DEBUG

//repetition
//------------------------------------------
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define REPS(i,a,n) for(int i=(a);i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define fi first
#define se second

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

// typedef
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
typedef vector<vint> Matrix;



bool bellman_ford(Matrix graph, int n, int s) { // nは頂点数、sは開始頂点
    // 戻り値がtrueなら負の閉路を含む
    vint dist = vint(n, INF);
    dist[s] = 0; // 開始点の距離は0
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            for (int k = 0; k < n; k++) {
                if (j == k) continue;
                int cost = graph[j][k];
                if (dist[j] != INF && dist[k] > dist[j] + cost) {
                    dist[k] = dist[j] + cost;
                    if (i == n - 1) return true; // n回目にも更新があるなら負の閉路が存在
                }
            }
        }
    }
    return false;
}

Matrix warshall_floyd(Matrix d, int n) { // nは頂点数
    // d[i][j] : i,j間の最短距離
    // ﾖi d[i][i] < 0 -> 負の閉路が存在
    for (int i = 0; i < n; i++)      // 経由する頂点
        for (int j = 0; j < n; j++)    // 開始頂点
            for (int k = 0; k < n; k++)  // 終端
                d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
    return d;
}

void print(vint v){
    REP(i, v.size()) cout << v[i] << " ";
}

void print(Matrix B){
    REP(i, B.size()){
        REP(j, B[i].size()){
            cout << B[i][j] << " ";
        }
        cout << endl;
    }
}

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

    int N;
    cin >> N;
    Matrix A = Matrix(N, vector<int>(N, 0));
    REP(i, N)REP(j, N)cin >> A[i][j];

    cout << -1;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:115:14: error: expected '}' at end of input
  115 |     return 0;
      |              ^
a.cc:105:12: note: to match this '{'
  105 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>  

using namespace std;

//#define int long long
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define INF (1 << 30)

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;

const int MOD = 1e9 + 7;
const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};

template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }
template <typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

int dist[300][300], a[300][300];
int V;

void Warshall_Floyd() {
    for(int k = 0; k < V; ++k) for(int i = 0; i < V; ++i) for(int j = 0; j < V; ++j) {
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
    }
}

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

    cin >> V;
    rep(i, V) rep(j, V) {
        dist[i][j] = (i == j) ? 0 : INF;
    }
    rep(i, V) rep(j, V) {
        cin >> a[i][j];
        dist[i][j] = a[i][j];
    }
    Warshall_Floyd();
    rep(i, V) rep(j, V) {
        if(dist[i][j] != a[i][j]) {
            cout << -1 << endl;
            return 0;
        }
    }
    int res = 0;
    rep(i, V - 1) FOR(j, i + 1, V) {
        bool flag = true;
        rep(k, V) {
            if(i != k && j != k && dist[i][j] == dist[i][k] + dist[k][j])
                    flag = false;
        }
        if(flag) res += dist[i][j];
    }
    cout << sum >> endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:13: error: 'sum' was not declared in this scope
   60 |     cout << sum >> endl;
      |             ^~~
Language: C++

#include <bits/stdc++.h>  

using namespace std;

//#define int long long
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define INF (1 << 30)

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;

const int MOD = 1e9 + 7;
const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};

template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }
template <typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

int dist[300][300], a[300][300];
int V;

void Warshall_Floyd() {
    for(int k = 0; k < V; ++k) for(int i = 0; i < V; ++i) for(int j = 0; j < V; ++j) {
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
    }
}

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

    cin >> V;
    rep(i, V) rep(j, V) {
        dist[i][j] = (i == j) ? 0 : INF;
    }
    rep(i, V) rep(j, V) {
        cin >> a[i][j];
        dist[i][j] = a[i][j];
    }
    Warshall_Floyd();
    rep(i, V) rep(j, V) {
        if(dist[i][j] != a[i][j]) {
            cout << -1 << endl;
            return 0;
        }
    }
    int res = 0;
    reo(i, V - 1) FOR(j, i + 1, V) {
        bool flag = true;
        rep(k, V) {
            if(i != k && j != k && dist[i][j] == dist[i][k] + dist[k][j])
                    flag = false;
        }
        if(flag) res += dist[i][j];
    }
    cout << sum >> endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:9: error: 'i' was not declared in this scope
   52 |     reo(i, V - 1) FOR(j, i + 1, V) {
      |         ^
a.cc:52:5: error: 'reo' was not declared in this scope; did you mean 'res'?
   52 |     reo(i, V - 1) FOR(j, i + 1, V) {
      |     ^~~
      |     res
a.cc:52:23: error: 'j' was not declared in this scope; did you mean 'jn'?
   52 |     reo(i, V - 1) FOR(j, i + 1, V) {
      |                       ^
a.cc:6:37: note: in definition of macro 'FOR'
    6 | #define FOR(i, j, k) for(int i = j; i < k; ++i)
      |                                     ^
a.cc:60:13: error: 'sum' was not declared in this scope
   60 |     cout << sum >> endl;
      |             ^~~
Language: C++

#include <stdio.h>
 
int
main(void)
{
    int n;
    scanf("%d", &n);
    int a[n][n];
    int i, j;
    for (i = 0; i < n; ++i)
        for (j = 0; j < n; ++j)
            scanf("%d", &a[i][j]);
 
    int k;
    long sum = 0;
    for (i = 0; i < n; ++i) {
        for (j = i+1; j < n; ++j) {
            int found = 1;
            for (k = 0; k < n; ++k) {
                if (k == i || k == j)
                    continue;
                int compound = a[i][k] + a[j][k];
                if (a[i][j] == compound) {
                    found = 0;
                    continue;
                }
                if (a[i][j] > compound) {
                    printf("-1\n");
                    return 0;
                }
            }
            if (found)
                sum += a[i][j];
        }
    }
    printf("%ld\n", sum);
    return 0;
}

Compiler output:
a.cc:2:1: error: extended character   is not valid in an identifier
    2 |  
      | ^
a.cc:13:1: error: extended character   is not valid in an identifier
   13 |  
      | ^
a.cc:2:1: error: '\U000000a0' does not name a type
    2 |  
      | ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
using lli = long long int;

int main(){
  int n;
  std::cin >> n;
  vector<vector<lli> > adj(n, vector<lli>(n, 0));
  vector<vector<int> > mini;
  for (int i = 0; i < n; i++) {
    vector<int> tmp(3);
    for (int j = 0; j < n; j++) {
      std::cin >> adj[i][j];
      tmp[0] = adj[i][j], tmp[1] = i, tmp[2] = j;
      if(i < j)mini.push_back(tmp);
    }
  }
  sort(mini.begin(), mini.end());
  vector<vector<lli> > dist = adj;
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        adj[i][j] = min(adj[i][j], adj[i][k] + adj[k][j]);
      }
    }
  }

  if(dist != adj){
    std::cout << -1 << std::endl;
    return 0;
  }
  dist = vector<vector<lli> >(n, vector<lli>(n, 2e9));
  for (int i = 0; i < n; i++) dist[i][i] = 0;
  lli ans = 0;
  for (int i = 0; i < mini.size(); i++) {
    int u = mini[i][1], v = mini[i][2];
    bool flag = false;
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++) {
        lli md = dist[j][u] + adj[u][v] + dist[v][k];
        if(md < dist[j][k]){
          dist[j][k] = dist[k][j] = md;
          flag = true;
        }
      }
    }
    if(flag) ans += adj[u][v];
  }
  std::cout << ans << std::endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |   sort(mini.begin(), mini.end());
      |   ^~~~
      |   short
Language: C

include <stdio.h>

int
main(void)
{
    int n;
    scanf("%d", &n);
    long a[n][n];
    int i, j;
    for (i = 0; i < n; ++i)
        for (j = 0; j < n; ++j)
            scanf("%ld", &a[i][j]);

    int k;
    long sum = 0;
    for (i = 0; i < n; ++i) {
        for (j = i+1; j < n; ++j) {
            int found = 1;
            for (k = 0; k < n; ++k) {
                if (k == i || k == j)
                    continue;
                long compound = a[i][k] + a[j][k];
                if (a[i][j] == compound) {
                    found = 0;
                    continue;
                }
                if (a[i][j] > compound) {
                    printf("-1\n");
                    return 0;
                }
            }
            if (found)
                sum += a[i][j];
        }
    }
    printf("%ld\n", sum);
    return 0;
}


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

#include <iostream>
#include <ostream>
#include <vector>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))

int N;
int64_t table[300][300];
int64_t table2[300][300];

class Path {
 public:
  Path(int from, int to, int dist) : from(from), to(to), dist(dist) {}

  friend int operator<(const Path &a, const Path &b) { return a.dist < b.dist; }
  friend std::ostream &operator<<(std::ostream &os, const Path &a) {
    os << a.from << " -> " << a.to << " : " << a.dist;
    return os;
  }

  int getFrom() { return from; }
  int getTo() { return to; }
  int getDist() { return dist; }

 private:
  int from, to, dist;
};

int havePath(int u, int v, int lessThan) {
  if (lessThan <= 0) return 0;
  if (u == v) return 1;
  for (int i = 0; i < N; i++) {
    if (i != u && table[u][i] < lessThan) {
      if (havePath(i, v, lessThan - table[u][i])) return 1;
    }
  }
  return 0;
}

int havePath2(int u, int v, int len, int cLen) {
  // std::cout << u << " " << v << std::endl;
  if (u == v && len == cLen) return len;
  if (cLen > len) return 0;
  for (int i = 0; i < N; i++) {
    if (i != u && table2[u][i] != 0) {
      int dist = havePath2(i, v, len, cLen + table2[u][i]);
      if (dist) return dist;
    }
  }
  return 0;
}

int main(int argc, char *argv[]) {
  std::cin >> N;

  for (int y = 0; y < N; y++) {
    for (int x = 0; x < N; x++) {
      std::cin >> table[y][x];
    }
  }

  std::vector<Path> paths;
  std::vector<Path> paths_use;

  for (int u = 0; u < N; u++) {
    for (int v = u + 1; v < N; v++) {
      paths.push_back(Path(u, v, table[u][v]));
      if (havePath(u, v, table[u][v])) {
        std::cout << -1 << std::endl;
        return 0;
      }
    }
  }

  std::sort(paths.begin(), paths.end());

  for (int i = 0; i < paths.size(); i++) {
    // std::cout << paths[i] << std::endl;
    if (havePath2(paths[i].getFrom(), paths[i].getTo(), paths[i].getDist(),
                  0) != paths[i].getDist()) {
      paths_use.push_back(paths[i]);
      table2[paths[i].getFrom()][paths[i].getTo()] = paths[i].getDist();
      table2[paths[i].getTo()][paths[i].getFrom()] = paths[i].getDist();
      // std::cout << "use" << std::endl;
    }
  }
  uint64_t sum = 0;
  for (int i = 0; i < paths_use.size(); i++) {
    sum += paths_use[i].getDist();
  }
  std::cout << sum << std::endl;
}



Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:76:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   76 |   std::sort(paths.begin(), paths.end());
      |        ^~~~
      |        qsort
a.cc:88:3: error: 'uint64_t' was not declared in this scope
   88 |   uint64_t sum = 0;
      |   ^~~~~~~~
a.cc:4:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    3 | #include <vector>
  +++ |+#include <cstdint>
    4 | 
a.cc:90:5: error: 'sum' was not declared in this scope
   90 |     sum += paths_use[i].getDist();
      |     ^~~
a.cc:92:16: error: 'sum' was not declared in this scope
   92 |   std::cout << sum << std::endl;
      |                ^~~
Language: C++

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

int map[310][310];
int dist[310][310];

int main(){
    int n;
    int tot=0;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            scanf("%d",&map[i][j]);
            scanf("%d",&dist[i][j]);
        }
    }
    for(int k=1;k<=n;k++){
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                if((i!=j)&&(map[i][j]>map[i][k]+map[k][j])){
                    printf("-1\n");
                    return 0;
                }
            }
        }
    }
    int tot=0;
    for(int i=1;i<=n;i++){


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: redeclaration of 'int tot'
   28 |     int tot=0;
      |         ^~~
a.cc:10:9: note: 'int tot' previously declared here
   10 |     int tot=0;
      |         ^~~
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

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

#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

int main(){
  int n;
  cin>>n;
  int a[n][n];
  rep(i,n){rep(j,n){
    cin>>a[i][j];
  }}
  int aaa=0;
  rep(i,n-1){
    FOR(j,i+1,i+2){
      aaa+=a[i][j];
    }}
    if(aaa>=a[n-1][n-1]){
      cout<<ans<<endl;
    }else{cout<<-1<<endl;}
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |       cout<<ans<<endl;
      |             ^~~
      |             abs
Language: C++

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

#define Gene template< class
#define Rics printer& operator,
Gene c> struct rge{c b, e;};
Gene c> rge<c> range(c i, c j){ return {i, j};}
struct printer{
    ~printer(){cerr<<endl;}
    Gene c >Rics(c x){ cerr<<boolalpha<<x; return *this;}
    Rics(string x){cerr<<x;return *this;}
    Gene c, class d >Rics(pair<c, d> x){ return *this,"(",x.first,", ",x.second,")";}
    Gene ... d, Gene ...> class c >Rics(c<d...> x){ return *this, range(begin(x), end(x));}
    Gene c >Rics(rge<c> x){
        *this,"["; for(auto it = x.b; it != x.e; ++it)
            *this,(it==x.b?"":", "),*it; return *this,"]";}
};
#define debug() cerr<<"LINE "<<__LINE__<<" >> ", printer()
#define dbg(x) "[",#x,": ",(x),"] "
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int my_rand(int l, int r) {
    return uniform_int_distribution<int>(l, r) (rng);
}

const int N = 3005;

bool dp[N][N];


int main() {
//    freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);

    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;

    dp[0][0] = 1;
    for(int i = 0; i <= f; i++) {
        for(int j = 0; j <= f; j++) {
            if(i + 100*a <= f) dp[i + 100*a][j] |= dp[i][j];
            if(i + 100*b <= f) dp[i + 100*b][j] |= dp[i][j];
            if(j + c <= f) dp[i][j+c] |= dp[i][j];
            if(j + d <= f) dp[i][j+d] |= dp[i][j];
        }
    }
    int p = A*100, q = 0;
    for(int i = 0; i <= f; i++) {
        for(int j = 0; j <= f; j++) {
            if(dp[i][j] == 0 or i+j == 0) continue;
            int max_sugar = (i/100) * e;
            if(j > max_sugar) continue;
            if(i+j > f) continue;
//            debug(), dbg(i), dbg(j);
            if(q*(i+j) < j*(p+q)) {
                p = i, q = j;
//                debug(), dbg(p), dbg(q);
            }
        }
    }
    cout << p+q << " " << q << endl;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:47:13: error: 'A' was not declared in this scope
   47 |     int p = A*100, q = 0;
      |             ^
a.cc:55:16: error: 'q' was not declared in this scope
   55 |             if(q*(i+j) < j*(p+q)) {
      |                ^
a.cc:61:15: error: 'q' was not declared in this scope
   61 |     cout << p+q << " " << q << endl;
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
constexpr int inf  = 1e8;
int water_ub(int A, int B, int F) {
    return (F/(100)) *  100;
}
int main(){
    int A,B,C,D,E,F;
    cin >> A >> B >> C >> D >> E >> F;
    int w_ub = water_ub(A,B,F);
    vector<vector<bool>>dp(w_ub + 1,vector<bool>(F,false));
    dp[0][0] = true;
    for(int i = 0; i < dp.size(); ++i){
        for(int j = 0; j < dp[i].size(); ++j){
            bool valid  = dp[i][j];
            if(not valid ) continue;
          	if(i + 1 < dp.size()) dp[i+ 1][w] = dp[i][w];
            if(i + A < dp.size())
                dp[i + A][j] = true;
            if(i + B < dp.size())
                dp[i + B][i] = true;
            if(j + C < dp[i].size() && i * 100 + j + C <= F && 100 * (j + C) <= E * i * 100)
                dp[i][j + C] = true;
            if(j + D < dp[i].size() && i * 100 + j + D <= F && 100 * (j + D) <= E * i * 100)
                dp[i][j + D] = true;
        }
    }
    pair<int,int>ans = {A*100,0};
    for(int i = 0; i < dp.size(); ++i){
        for(int j = 0 ; j < dp[i].size(); ++j){
            if(not dp[i][j]) continue;
            if((ans.second) * (i * 100  + j) < (j) * (ans.first))
                ans = {i * 100 + j,j};
        }
    }
    cout << ans.first << " " << ans.second << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:48: error: 'w' was not declared in this scope
   18 |                 if(i + 1 < dp.size()) dp[i+ 1][w] = dp[i][w];
      |                                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
  bitset<3010> water,sugar;
  int a,b,c,d,e,f;
  cin>>a>>b>>c>>d>>e>>f;
  a*=100;
  b*=100;
  rep(i,f/a+1){
     water|=water<<a;
     water.set(a); 
  }
  rep(i,f/b+1){
     water|=water<<b;
     water.set(b); 
  }
  rep(i,f/c+1){
     sugar|=sugar<<c;
     sugar.set(c); 
  }
  rep(i,f/d+1){
     sugar|=sugar<<d;
     sugar.set(d); 
  }
  int s;
  pair<int,int> p={0,0};
  for(int i=100;i<=f;i+=100){
    if(water.test(i)){
      s=i/100*e;
      int k=0;
      for(int j=0;j<=s&&i+j<=f;j++)
         if(sugar.test(j))
           k=j;
      if(k){
      double d1=p.second/(double) p.first;
      double d2=k/(double)i;
         if(p.first==0 || d2>d1 // k>p.second*i/p.first){
            p.first=i;
            p.second=k;
         }
      }
    }
  }
  
  cout<<p.first+p.second<<" "<<p.second;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:32: error: expected ';' before 'p'
   38 |          if(p.first==0 || d2>d1 // k>p.second*i/p.first){
      |                                ^
      |                                ;
   39 |             p.first=i;
      |             ~                   
a.cc:40:23: error: expected ')' before ';' token
   40 |             p.second=k;
      |                       ^
      |                       )
a.cc:38:12: note: to match this '('
   38 |          if(p.first==0 || d2>d1 // k>p.second*i/p.first){
      |            ^
a.cc: At global scope:
a.cc:46:3: error: 'cout' does not name a type
   46 |   cout<<p.first+p.second<<" "<<p.second;
      |   ^~~~
a.cc:47:3: error: expected unqualified-id before 'return'
   47 |   return 0;
      |   ^~~~~~
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define INIT(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define INIT2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}

int main(){
  int A,B,C,D,E,F; cin>>A>>B>>C>>D>>E>>F;
  bool dp1[4000];
  bool dp2[4000];
  dp1[0] = 1;
  dp2[0] = 1;
  REP(x,C){
    if(dp1[x]){
      if(x+a<C){ dp1[x+A] = 1;}
      if(x+b<C){ dp1[x+B] = 1;}
    }
    if(dp2[x]){
      if(x+c<C){ dp2[x+C] = 1;}
      if(x+d<C){ dp2[x+D] = 1;}
    }
  }
  
  int p = 0;
  int q = A;
  for(int x=1; x<=F/100; x++){
    if(!dp1[x]){continue;}
    for(int y = 0; x*100+y<=f; y++){
      if( y>x*E){break;}
      if(!dp2[y]){continue;}
      if(y*q>x*p){
        p = y;
        q = x;
      }
    }
  }
  printf("%d %d\n",p+q*100,p);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: 'a' was not declared in this scope
   34 |       if(x+a<C){ dp1[x+A] = 1;}
      |            ^
a.cc:35:12: error: 'b' was not declared in this scope
   35 |       if(x+b<C){ dp1[x+B] = 1;}
      |            ^
a.cc:38:12: error: 'c' was not declared in this scope
   38 |       if(x+c<C){ dp2[x+C] = 1;}
      |            ^
a.cc:39:12: error: 'd' was not declared in this scope
   39 |       if(x+d<C){ dp2[x+D] = 1;}
      |            ^
a.cc:47:29: error: 'f' was not declared in this scope
   47 |     for(int y = 0; x*100+y<=f; y++){
      |                             ^
Language: C++

#include <iostream>

using namespace std;

const int MAX_N = 3e3 + 5;

int can_sug [MAX_N];
int can_wat [MAX_N];

int ceil (int p, int q) {
  return (p + q - 1) / q;
}

int main () {
  ios::sync_with_stdio(false);

  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;

  for (int i = 0; i <= f; i += c) {
    can_sug[i] = 1;
  }

  for (int i = 0; i + d <= f; i++) {
    if (can_sug[i]) {
      can_sug[i + d] = 1;
    }
  }

  for (int i = 0; i <= f; i += 100 * a) {
    can_wat[i] = i;
  }

  for (int i = 0; i + 100 * b <= f; i++) {
    if (can_wat[i]) {
      can_wat[i + 100 * b] = i + 100 * b;
    }
  }

  can_wat[f + 1] = f + 1;
  for (int i = f; i >= 0; i--) {
    if (!can_wat[i]) {
      can_wat[i] = can_wat[i + 1];
    }
  }
  
  int cur_sug = 0, cur_tot = 100 * a;
  for (int i = 1; i <= f; i++) {
    if (can_sug[i]) {
      if (need_wat <= f) {
        need_wat = can_wat[need_wat];
        if (i + need_wat <= f) {
          int sug = i;
          int tot = i + need_wat;
          if (sug * (cur_tot) >= cur_sug * tot) {
            cur_sug = sug;
            cur_tot = tot;
          }
        }
      }
    }
  }

  cout << cur_tot << " " << cur_sug << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:11: error: 'need_wat' was not declared in this scope
   50 |       if (need_wat <= f) {
      |           ^~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include <cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    int a_max = f / (100 * a);
    double percent_max = 0;
    int ans_sugerwater = 0, ans_sugar = 0;
    rep(i, a_max + 1) {
        int b_max = (f - 100 * i) / (100 * b);
        rep(j, b_max + 1) {
            int water = 100 * a * i + 100 * b * j;
            int sugar_max = f - water;
            int c_max = sugar_max / c;
            rep(k, c_max + 1) {
                int d_max = (sugar_max - c) / d;
                rep(l, d_max + 1) {
                    double percent = (double)(100 * (c * k + d * l)) / ((double)(a * i + b * j) * 100);
                    if(percent > percent_max) {
                        ans_sugarwater = 100 * (a * i + b * j) + c * k + d * l;
                        ans_sugar = c * k + d * l;
                    }
                }
            }

        }
    }
    cout << ans_sugarwater << " " << ans_sugar << endl;
 	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:25: error: 'ans_sugarwater' was not declared in this scope; did you mean 'ans_sugerwater'?
   73 |                         ans_sugarwater = 100 * (a * i + b * j) + c * k + d * l;
      |                         ^~~~~~~~~~~~~~
      |                         ans_sugerwater
a.cc:81:13: error: 'ans_sugarwater' was not declared in this scope; did you mean 'ans_sugerwater'?
   81 |     cout << ans_sugarwater << " " << ans_sugar << endl;
      |             ^~~~~~~~~~~~~~
      |             ans_sugerwater
Language: C++

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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;

int main() {
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    set<int> w;
    REP(i, 
}


Compiler output:
a.cc:17:2: error: unterminated argument list invoking macro "REP"
   17 | }
      |  ^
a.cc: In function 'int main()':
a.cc:16:5: error: 'REP' was not declared in this scope
   16 |     REP(i,
      |     ^~~
a.cc:16:8: error: expected '}' at end of input
   16 |     REP(i,
      |        ^
a.cc:12:12: note: to match this '{'
   12 | int main() {
      |            ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
const int M=100010;
const int INF=1000000007;
using ll=long long;

int main() {
	int A,B,C,D,E,F;
	cin>>A>>B>>C>>D>>E>>F;
	int suger=-1,suger_water=-1;
	for(int i=1;i<=F;i+=100*A){
		for(int j=0;i+j<=F;j+=100*B) {
			for(int k=0;i+j+k<=F;k+=C){
				for(int l=0;i+j+k+l<=F;l+=D){
					if(i+j+k+l==0||(100+E)*(k+l)>E*(i+j+k+l))continue;
					if (suger==-1||suger*(i+j+k+l)<suger_water*(k+l))){
						suger=k+l;
						suger_water=i+j+k+l;
					}
				}
			}
		}
	}
	cout<<suger_water<<" "<<suger<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:90: error: expected primary-expression before ')' token
   18 |                                         if (suger==-1||suger*(i+j+k+l)<suger_water*(k+l))){
      |                                                                                          ^
Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T &a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T &a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int a, b, c, d, e, f;
bool dp[4000];
signed main() {
	cin >> a >> b >> c >> d >> e >> f;
	for (int i = 0; i * c <= f; i++) {
		dp[i*c] = 1;
	}
	for (int i = 0; i + d <= f; i++) {
		dp[i + d] |= dp[i];
	}
	ld res = 0, u = 0, v = 0;
	for (int i = 0; i * a * 100 <= f; i++) {
		for (int j = 0; (i * a + j * b) * 100 <= f; j++) {
			if (i + j == 0) continue;
			int k = (i * a + j * b) * 100;
			for (int z = 0; z <= k / 100 * e && k + z <= f; z++) {
				if (dp[z]) {
					if (res < z * 100. / (k + z)) {
						u = k, v = z;
					}
				}
			}
		}
	}
	cout << u << " " << u+v << endl:
}

Compiler output:
a.cc: In function 'int main()':
a.cc:120:40: error: expected ';' before ':' token
  120 |         cout << u << " " << u+v << endl:
      |                                        ^
      |                                        ;
Language: C++

`#include <bits/stdc++.h>

using namespace std;

#define llong long long int
#define ldouble long double
#define ternary(condition, x, y) ((condition) ? x : y) 
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) x.begin(), x.end()
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)

const static llong MOD = 1000000000 + 7;
const static int dy[] = {0, 1, 0, -1};
const static int dx[] = {1, 0, -1, 0};

int main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    double concentration = -1;
    int ans_sum = 0, ans_sugar = 0;
    for (int i = 0; i <= f / (100 * a); ++i) {
        for (int j = 0; 100 * b * j <= f - 100 * a * i; ++j) {
            int water = 100 * a * i + 100 * b * j;
            int sugar_can_be_dissolved = (a * i + b * j) * e;
            // cout << water << " " << sugar_can_be_dissolved << endl;
            if (water + sugar_can_be_dissolved <= f) {
                // cout << "sum " << water + sugar_can_be_dissolved << " sugar " << sugar_can_be_dissolved << " water " << water << endl;
                for (int k = 0; k <= sugar_can_be_dissolved / c; ++k) {
                    for (int l = 0; d * l <= sugar_can_be_dissolved - c * k; ++l) {
                        // cout << "sum " << water + sugar_can_be_dissolved << " sugar " << sugar_can_be_dissolved << " water " << water << " c " << k * c << " d " << l * d <<  " sum " << k * c + l * d << endl;
                        double tmp = ((double)k * c + l * d) / ((double)water + k * c + l * d);
                        tmp *= 100.0;
                        if (tmp >= concentration) {
                            ans_sum = water + k * c + l * d;
                            ans_sugar = ans_sum - water;
                            concentration = tmp;
                        }
                    }
                }
            }
        }
    }

    cout << ans_sum << " " << ans_sugar << endl;

    return 0;
}


Compiler output:
a.cc:1:1: error: stray '`' in program
    1 | `#include <bits/stdc++.h>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | `#include <bits/stdc++.h>
      |  ^
a.cc:1:3: error: 'include' does not name a type
    1 | `#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc: In function 'int main(int, char**)':
a.cc:17:5: error: 'cin' was not declared in this scope
   17 |     cin.tie(0);
      |     ^~~
a.cc:18:5: error: 'ios' has not been declared
   18 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:47:5: error: 'cout' was not declared in this scope
   47 |     cout << ans_sum << " " << ans_sugar << endl;
      |     ^~~~
a.cc:47:44: error: 'endl' was not declared in this scope
   47 |     cout << ans_sum << " " << ans_sugar << endl;
      |                                            ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>
int main(){
    ll A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;
    P ans = P(F, 0);
    for(ll a = 0; 100 * a * A <= F; a++){
        for(ll b = 0; 100 * a * A + 100 * b * B <= F; b++){
            ll water = 100 * a * A + 100 * b * B;
            for(ll c = 0; water + c * C <= F; c++){
                for(ll d = 0; water + c * C + d * D <= F; d++){
                    ll suger = c * C + d * D;
                    if(water / 100 * E < suger) continue;
                    if(ans.second * (water + suger) < suger * ans.first) ans = P(water + suger, suger);
                }
            }
        }
    }
    cout << ans.first << " " << ans.second << endl;
    return 0;
}


Compiler output:
a.cc:4:11: error: two or more data types in declaration of 'type name'
    4 | using P = pair<ll, ll>
      |           ^~~~~~~~~~~~
Language: Java


Copy
import java.util.Scanner;
import java.util.stream.IntStream;
 
public class Main{
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}
 
	public static void main(String[]$){
		int
		a=getInt(),
		b=getInt(),
		c=getInt(),
		d=getInt(),
		e=getInt(),
		f=getInt();
 
		int rw=100*a,rs=0;
		double max=0;
 
		for(int i=0;true;++i) {
			int va=100*a*i;
			if(va>f)
				break;
			for(int j=0;true;++j) {
				int vb=100*b*j;
				if(va+vb>f)
					break;
				for(int k=0;true;++k) {
					int vc=c*k;
					if(va+vb+vc>f)
						break;
					for(int l=0;true;++l) {
						int vd=d*l;
						if(va+vb+vc+vd>f)
							break;
						if(max<calc(va+vb,vc+vd,e)) {
							max=calc(va+vb,vc+vd,e);
							rw=va+vb;
							rs=vc+vd;
						}
					}
				}
			}
		}
		System.out.println(rw+rs+" "+rs);
	}
	private static double calc(int w,int s,int e){
		double r=w==0?0:100.0*s/(w+s);
		return w/100*e<s?0:r;
	}
}

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
Copy
^
Main.java:4: error: class, interface, enum, or record expected
import java.util.stream.IntStream;
^
2 errors
Language: C++

#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>

using namespace std;
// 10:12
int main()
{
    int A, B, C, D, E, F;
    std::cin >> A >> B >> C >> D >> E >> F;

    std::set<int> waterCandidates;

    for (int a = 0; 100*A * a <= F; ++a) {
        for (int b = 0; 100*B * b <= F; ++b) {
            const auto w = 100 * a*A + 100 * b*B;
            if (0 < w && W <= F) {
                waterCandidates.insert(w);
            }
        }
    }

    std::set<int> sugerCandidates;
    for (int c = 0; C * c < F; ++c) {
        for (int d = 0; D * d < F; ++d) {
            if (c*C + d*D <= F) {
                sugerCandidates.insert(c*C + d*D);
            }
        }
    }

    double md = 0;
    int mw = 0;
    int ms = 0;

    for (auto w : waterCandidates) {
        for (auto s : sugerCandidates) {
            if (w + s <= F && s <= E * (w /100)) {
                auto d = 100.0*s/(w + s);
                if (md < d) {
                    mw = w;
                    ms = s;
                    md = d;
                }
            }
        }
    }

    std::cout << mw + ms << " " << ms << std::endl;

    return 0;
}


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

#include <iostream>
using namespace std;
 
int main() {
  int A, B, C, D, E, F;
  cin >> A >> B >> C >> D >> E >> F;
  int total = 100 * A, sugar = 0;
  for (int a = 0; a <= F; a += A * 100) {
    for (int b = 0; a + b <= F; b += B * 100) {
      int w = a + b;
      if (w > 0) {
        for (int c = 0; w + c <= F && c * 100 <= w * E; c += C) {
          int d = min(F - w - c, ((w * E - c * 100) / 100) / D * D);
          int s = c + d;
          int t = w + s;
          if (s * total > sugar * t) {
            total = t;
            sugar = s;
          }
        }
      }
    }
  }
  cout << total << " " << sugar << endl;
  return 0;
}
#include <iostream>
using namespace std;

int main() {
  int A, B, C, D, E, F;
  cin >> A >> B >> C >> D >> E >> F;
  int total = 100 * A, sugar = 0;
  for (int a = 0; a <= F; a += A * 100) {
    for (int b = 0; a + b <= F; b += B * 100) {
      int w = a + b;
      if (w > 0) {
        for (int c = 0; w + c <= F && c * 100 <= w * E; c += C) {
          int d = min(F - w - c, (w * E - c * 100) / 100) / D * D;
          int s = c + d;
          int t = w + s;
          if (s * total > sugar * t) {
            total = t;
            sugar = s;
          }
        }
      }
    }
  }
  cout << total << " " << sugar << endl;
  return 0;
}


Compiler output:
a.cc:30:5: error: redefinition of 'int main()'
   30 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

int main() {
  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;

  auto ans = make_pair(0, 100);
  for (int ia = 0; 100 * ia * a < f; ia++) {
    for (int ib = 0; 100 * (ia * a + ib * b) < f; ib++) {
      int water = 100 * (ia * a + ib * b);
      for (int ic = 0; water + ic * c < f; ic++) {
        for (int id = 0; water + (ic * c + id * d) < f; id++) {
          int sugger = ic * c + id * d;
          int total = sugger + water;
          if (sugger * 100 <= water * e && sugger * ans.second > ans.first * total) {
            ans = make_pair(sugger, total);
          }
        }
      }
    }
  }

  cout << ans.second << " " << ans.first << 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<algorithm>
#include<vector>
#include<string>
#include<utility>
#define REP(i,n) for(int i = 0;i < (n);i++)
#define pb push_back
using namespace std;
const int INF = 1e9;
typedef long long ll;

int main(){
  ll a,b,c,d,e,f;
  cin >> a >> b>> c >> d >> e >> f;
  int flag = 1;
  ll sum = 0;
  vector <ll> A;
  REP(i,f/a+1){
    REP(j,f/b+1){
      sum = a*100*i+ b*100*j;
      if(sum <= f){
	A.pb(sum);
      }
      else
	break;
    }

  }
  vector <ll> B;
  REP(i,f){
    REP(j,f){
      sum = c*i+ d*j;
      if(sum <= f){
	B.pb(sum);
      }
      else
	break;
    }

  }
  //cout << "sfgsf" << endl; 
  /*REP(i,A.size()){
    cout << A[i] << "  ";
  }
  cout << endl;
  sort(B.begin(),B.end());
  REP(i,B.size()){
    cout << B[i] << "  ";
  }
  cout << endl;*/
  double res,E,bres = 0;
  ll sum1=0,sum2=0;
  vector
  REP(i,A.size()){
    REP(j,B.size()){
      
      if(A[i] != 0){
	res = (double)B[j]/(A[i]+B[j])*100;
	E = (double)e/(100+e)*100;
	//cout << res  << "  " << E << endl;
	if(A[i]+B[j] <= f && res <= E){
	  if(res >= bres){
	    sum1 = A[i]+B[j];
	    sum2 = B[j];
	    bres = res;
	  }
	}
      }
    }
  }
  if(sum1 == 0)
    sum1 = A[2];
  cout << sum1 << " " << sum2 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected unqualified-id before 'for'
    6 | #define REP(i,n) for(int i = 0;i < (n);i++)
      |                  ^~~
a.cc:54:3: note: in expansion of macro 'REP'
   54 |   REP(i,A.size()){
      |   ^~~
a.cc:54:7: error: 'i' was not declared in this scope
   54 |   REP(i,A.size()){
      |       ^
a.cc:6:32: note: in definition of macro 'REP'
    6 | #define REP(i,n) for(int i = 0;i < (n);i++)
      |                                ^
Language: Java

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class sugarWater2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int D = sc.nextInt();
        int E = sc.nextInt();
        int F = sc.nextInt();

        Set<Integer> waterSet = new HashSet<>();
        Set<Integer> sugarSet = new HashSet<>();
        createSugar(sugarSet, C, D, F);
        createWater(waterSet, A, B, F);

        double maxRatio = 0;
        int resultSugar = 0;
        int resultWater = 0;

        for (int water : waterSet) {
            for (int sugar : sugarSet) {
                if ((water + sugar) <= F
                        && ((double)sugar * 100 / water) <= E
                        && ((double)(100 * sugar) / (water + sugar) > maxRatio))  {
                    maxRatio = (double)(100 * sugar) / (water + sugar);
                    resultSugar = sugar;
                    resultWater = water;
                }
            }
        }

        System.out.println(resultSugar + resultWater + " " + resultSugar);


    }

    private static void createWater (Set<Integer> waterSet, int A, int B, int F) {
        for (int i = 0; i < F / 100 / A  + 1; i++) {
            for (int j = 0; j < F / 100 / B + 1; j++) {
                int water = A * 100 * i + B * 100 * j;
                if (water <= F) waterSet.add(water);
            }
        }
    }

    private static void createSugar(Set<Integer> sugarSet, int C, int D, int F) {
         for (int i = 0; i < F / C  + 1; i++) {
            for (int j = 0; j < F / D + 1; j++) {
                int water = C * i + D * j;
                if (water <= F) sugarSet.add(water);
            }
        }
    }

}

Compiler output:
Main.java:5: error: class sugarWater2 is public, should be declared in a file named sugarWater2.java
public class sugarWater2 {
       ^
1 error
Language: Java

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class sugarWater2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int D = sc.nextInt();
        int E = sc.nextInt();
        int F = sc.nextInt();

        Set<Integer> waterSet = new HashSet<>();
        Set<Integer> sugarSet = new HashSet<>();
        createSugar(sugarSet, C, D, F);
        createWater(waterSet, A, B, F);

        double maxRatio = 0;
        int resultSugar = 0;
        int resultWater = 0;

        for (int water : waterSet) {
            for (int sugar : sugarSet) {
                if ((water + sugar) <= F
                        && ((double)sugar * 100 / water) <= E
                        && ((double)(100 * sugar) / (water + sugar) > maxRatio))  {
                    maxRatio = (double)(100 * sugar) / (water + sugar);
                    resultSugar = sugar;
                    resultWater = water;
                }
            }
        }

        System.out.println(resultSugar + resultWater + " " + resultSugar);


    }

    private static void createWater (Set<Integer> waterSet, int A, int B, int F) {
        for (int i = 0; i < F / A  + 1; i++) {
            for (int j = 0; j < F / B + 1; j++) {
                int water = A * 100 * i + B * 100 * j;
                if (water <= F) waterSet.add(water);
            }
        }
    }

    private static void createSugar(Set<Integer> sugarSet, int C, int D, int F) {
         for (int i = 0; i < F / C  + 1; i++) {
            for (int j = 0; j < F / D + 1; j++) {
                int water = C * i + D * j;
                if (water <= F) sugarSet.add(water);
            }
        }
    }

}

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

#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define F first
#define S second
 
#define ler freopen("inspection.in","r",stdin);freopen("inspection.out","w",stdout)
#define fastio ios::sync_with_stdio(0), cin.tie(0)
#define rep(i,a,b) for(int i=a; i<b; i++)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define sz(a) ((int)(a).size())
#define debug cout<<"sakdasopk\n"
 
#define pdd pair<ld,ld> 
#define ll long long
#define ld long double
#define vi vector<int> 
#define pii pair<int,int>  
 
#define MAXN 3333
#define EPS 1e-8
#define INF 1e18L
#define LOG 19
#define int ll
	
int a, b, c, d, e, f;
int v1[MAXN], v2[MAXN];
int ansA=0, ansB=0;

void add(int x, int y){
	if(ansA==0) ansA=x, ansB=y;
	else if(x*ansB > ansA*y){
		ansA= x;
		ansB= y;
	}
}

int main(){
	cin >> a >> b >> c >> d >> e >> f;
	
	v1[0]= v2[0]= 1;
	for(int i=0; i<MAXN; i++){
		if(v1[i] && i+a*100 < MAXN)
			v1[i+a*100]=1;
		if(v1[i] && i+b*100 < MAXN)
			v1[i+b*100]=1;
			
		if(v2[i] && i+c < MAXN)
			v2[i+c]=1;
		if(v2[i] && i+d < MAXN)
			v2[i+d]=1;
	}

	for(int i=1; i<MAXN; i++){	
		if(!v2[i]) continue;
		for(int j=a*100; i+j<=f; j++){
			if(v1[j] && e*j >= i*100){
				add(i,j);
			}
		}
	}
	
	cout << ansB+ansA << " " << ansA << endl;
}



Compiler output:
cc1plus: error: '::main' must return 'int'