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

#include<iostream>
#include<complex>
using namespace std;
int main(){
  int i,n,k;
  cin >> n;
  cin >> k;

  double dist,xi;
  dist = 0;
  for (i=0; i<n; i++){
    cin >> xi;
    double dist_b = abs(x[i] - k);
    if(xi <= dist_b) dist += 2 * xi;
    else dist += 2 * dist_b;
  }

  cout << dist << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'x' was not declared in this scope; did you mean 'xi'?
   13 |     double dist_b = abs(x[i] - k);
      |                         ^
      |                         xi
Language: C++

use std::io;
use std::cmp;

fn main() {
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin
        .read_line(&mut buf)
        .unwrap();
    let n: i64 = buf.trim().parse().unwrap();

    buf = String::new();
    stdin
        .read_line(&mut buf)
        .unwrap();
    let k: i64 = buf.trim().parse().unwrap();

    buf = String::new();
    stdin
        .read_line(&mut buf)
        .unwrap();
    let x: Vec<i64> = buf.split_whitespace()
        .map(|n| n.parse().unwrap())
        .collect();

    let mut ans = 0;
    for i in x {
        ans += cmp::min(i*2, (k-i)*2);
    }

    println!("{}", ans);
}


Compiler output:
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io;
      | ^~~
a.cc:2:1: error: 'use' does not name a type
    2 | use std::cmp;
      | ^~~
a.cc:4:1: error: 'fn' does not name a type
    4 | fn main() {
      | ^~
Language: C

#include<stdio.h>
int main(){
int N,K;
int X[k+1];
 
int min(int a, int b){
if(a<=b) return a;
if(a>b)   return b;
}
 
scanf("%d", &N);
scanf("%d", &K);
for(int i =0; i<N; i++){
     scanf("%d",&X[i]);
     }
int sum =0;
for(int i =0; i <N; i++){
     int tmp = min( X[i], N-X[i]);
     sum = sum + tmp;
}
printf("%d", sum*2);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:7: error: 'k' undeclared (first use in this function)
    4 | int X[k+1];
      |       ^
main.c:4:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
int N,K;
int X;

scanf("%d %d", &N, &K);
for( int i=0; i<N, ++i){
scanf("%d", X+1);
}
int ans =0;
for(int i=0; i<N;++i){
int tmp= min(X[i],K-X[i]);
ans += tmp;
}
printf("%d\n", ans *2);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:23: error: expected ';' before ')' token
    7 | for( int i=0; i<N, ++i){
      |                       ^
      |                       ;
main.c:12:10: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   12 | int tmp= min(X[i],K-X[i]);
      |          ^~~
      |          main
main.c:12:15: error: subscripted value is neither array nor pointer nor vector
   12 | int tmp= min(X[i],K-X[i]);
      |               ^
main.c:12:22: error: subscripted value is neither array nor pointer nor vector
   12 | int tmp= min(X[i],K-X[i]);
      |                      ^
Language: C

main(k,x,a){for(scanf("%*d%d",&k);~scanf("%d",&x);)a+=min(a,k-a);printf("%d",2*a);}


Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(k,x,a){for(scanf("%*d%d",&k);~scanf("%d",&x);)a+=min(a,k-a);printf("%d",2*a);}
      | ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'k' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(k,x,a){for(scanf("%*d%d",&k);~scanf("%d",&x);)a+=min(a,k-a);printf("%d",2*a);}
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(k,x,a){for(scanf("%*d%d",&k);~scanf("%d",&x);)a+=min(a,k-a);printf("%d",2*a);}
main.c:1:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(k,x,a){for(scanf("%*d%d",&k);~scanf("%d",&x);)a+=min(a,k-a);printf("%d",2*a);}
      |                 ^~~~~
main.c:1:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:55: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
    1 | main(k,x,a){for(scanf("%*d%d",&k);~scanf("%d",&x);)a+=min(a,k-a);printf("%d",2*a);}
      |                                                       ^~~
      |                                                       main
main.c:1:66: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(k,x,a){for(scanf("%*d%d",&k);~scanf("%d",&x);)a+=min(a,k-a);printf("%d",2*a);}
      |                                                                  ^~~~~~
main.c:1:66: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:66: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:66: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
using namespace std;
int int main() {
  int N, K;
  cin >> N >> K;
  int x, ans=0;
  for(int i=0; i<N; i++){
    cin >> x;
    ans += 2 * min(x, K-x);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:3:1: error: two or more data types in declaration of 'main'
    3 | int int main() {
      | ^~~
Language: C

#include<stdio.h>

int main(void)
{
int n, k, x;
int i, min, sum;

scanf("%d %d", &n, &k);

for(i = 1; i <= n; i++){
scanf("%d", &x);
a = x * 2;
b = (k - x) * 2;
if(a < b){
min = a;
}else{
min = b;
}
sum += min;
}

printf("%d", sum);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:1: error: 'a' undeclared (first use in this function)
   12 | a = x * 2;
      | ^
main.c:12:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:1: error: 'b' undeclared (first use in this function)
   13 | b = (k - x) * 2;
      | ^
Language: C++

#include <iostream>
using namespace std;

int N,K;
int x[109];
int main(){
  cin>>N>>K;
  for(int i=0;i<N;i++){
    cin>>x[i];
  }
  int ans=0;
  for(int i=0;i<N;i++){
    ans+=K-x[i]<K ? k-x[i] : x[i];
  }
  cout<<ans*2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: 'k' was not declared in this scope
   13 |     ans+=K-x[i]<K ? k-x[i] : x[i];
      |                     ^
Language: C++

#include <iostream>
using namespace std;

int N,K;
int x[109];
int main(){
  cin>>N>>K;
  for(int i=0;i<N;i++){
    cin>>x[i];
  }
  int ans=0;
  for(int i=0;i<N;i++){
    ans+=K-x[i]<K ? k-x[i] : x[i]
  }
  cout<<ans*2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: 'k' was not declared in this scope
   13 |     ans+=K-x[i]<K ? k-x[i] : x[i]
      |                     ^
Language: C++

#include <iostream>
using namespace std;

int N,K;
int[109] x;
int main(){
  cin>>N>>K;
  for(int i=0;i<N;i++){
    cin<<x[i];
  }
  int ans=0;
  for(int i=0;i<N;i++){
    ans+=K-x[i]<K ? k-x[i] : x[i]
  }
  cout<<ans*2<<endl;
}

Compiler output:
a.cc:5:5: error: expected identifier before numeric constant
    5 | int[109] x;
      |     ^~~
a.cc:5:5: error: expected ']' before numeric constant
    5 | int[109] x;
      |     ^~~
      |     ]
a.cc:5:4: error: structured binding declaration cannot have type 'int'
    5 | int[109] x;
      |    ^
a.cc:5:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:5:4: error: empty structured binding declaration
a.cc:5:10: error: expected initializer before 'x'
    5 | int[109] x;
      |          ^
a.cc: In function 'int main()':
a.cc:9:10: error: 'x' was not declared in this scope
    9 |     cin<<x[i];
      |          ^
a.cc:13:12: error: 'x' was not declared in this scope
   13 |     ans+=K-x[i]<K ? k-x[i] : x[i]
      |            ^
a.cc:13:21: error: 'k' was not declared in this scope
   13 |     ans+=K-x[i]<K ? k-x[i] : x[i]
      |                     ^
Language: C++

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

int N, K;
int x[102];

int s;

int main() {
  
  cin>>N>>K;
  rep(i, N)cin>>x[i];
  
  rep(i, N)s = (x[i]<(K-x[i]) ? x[i] : (K-x[i]));
  
  cout<<s<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   rep(i, N)cin>>x[i];
      |       ^
a.cc:12:3: error: 'rep' was not declared in this scope
   12 |   rep(i, N)cin>>x[i];
      |   ^~~
Language: Java

import java.util.Scanner;

public class Main3 {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int sum = 0;
		if (b > 1) {
			for (int i = 0; i < a; i++) {
				int c = sc.nextInt();
				if (b-c >= c) {
					sum += c * 2;
				} else if (c >= b-c) {
					sum += b * 2;
				}
			}
			System.out.println(sum);
		} else if (b == 1) {
			int d = sc.nextInt();
			if (b-d >= d) {
				System.out.println(d * 2);
			} else if (d >= b-d) {
				System.out.println(b * 2);
			}
		}
	}

}

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

#include<stdio.h>
 
int main(void)
{
  int n, k, x;
  int min, Min = 0;
  int i;
  
  scanf("%d %d", &n, &k);
  for(i = 0; i <= n; i++){
    scanf("%d", &x);
    min = 2 * x;
    k = 2 * (k - x);
    if(k - min <= 0){
      min = min;
    }else{
      min = k;
    }
    Min += min;
  }
  printf("%d", Min);
  
  return 0;
}

Compiler output:
main.c:2:1: error: stray '\302' in program
    2 | <U+00A0>
      | ^~~~~~~~
Language: C

#include<stdio.h>

int main(void)
{
  int n, k, x;
  int min, Min = 0;
  int i;
  
  scanf("%d %d", &n, &m);
  for(i = 0; i <= n; i++){
    scanf("%d", &x);
    min = 2 * x;
    k = 2 * (k - x);
    if(k - min <= 0){
      min = min;
    }else{
      min = k;
    }
    Min += min;
  }
  printf("%d", Min);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:23: error: 'm' undeclared (first use in this function)
    9 |   scanf("%d %d", &n, &m);
      |                       ^
main.c:9:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main ()
{
	int  n,k;
	int x[100];
	unsigned int mina[100];
	int sum=0;
	cin>>n>>k;
	for(int i=0;i<n;i++)
	{
	cin>>x[i];
		if(x[i]-n>0&&x[i]-k>0)
		{
			mina[i]=min(n,k);
			sum+=(x[i]-mina[i]+1)*2;
		}
	
		else{
	mina[i]=max(x[i]-n,x[i]-k);
			sum+=(x[i]-mina[i]+1)*2;
	}
	}
	cout<<sum<<endl;
			
		
	
				

Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: expected '}' at end of input
   27 |         cout<<sum<<endl;
      |                         ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<sstream>
#include <set>
int ProjectB();

int main()
{

	ProjectB();
	return 0;
}
int ProjectB()
{
	int i, j, k, m, n, a, b, c, tc, o, ans, q, x, y;
	scanf("%d", &n);
	scanf("%d", &k);
	
	int sx[10000];
	for (i = 0; i<n; i++)
		cin >> sx[i];


	int sum = 0;

	for (i = 0; i < n; i++)
	{
		if (k / 2 <= sx[i]) 
		{
			//kを採用
			sum = sum + abs(k - sx[i]) * 2;
		}
		else
		{
			//0を採用
			sum = sum + sx[i] * 2;
		}
	}

}

Compiler output:
a.cc: In function 'int ProjectB()':
a.cc:31:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   31 |                 cin >> sx[i];
      |                 ^~~
      |                 std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:50:1: warning: no return statement in function returning non-void [-Wreturn-type]
   50 | }
      | ^
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
          		int sum = 0;
                int N = sc.nextInt();
                int K = sc.nextInt();
                for(int i = 1;i<= N;i++){
                	int x = sc.nextInt();
                  	if(x > abs(x - K)){
                      sum = sum + 2 * abs(x-K);
                    }else{
                    	sum = sum + 2 * x;
                    }
                }
                System.out.println(sum);
        }
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
                  	if(x > abs(x - K)){
                  	       ^
  symbol:   method abs(int)
  location: class Main
Main.java:12: error: cannot find symbol
                      sum = sum + 2 * abs(x-K);
                                      ^
  symbol:   method abs(int)
  location: class Main
2 errors
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
          		int sum = 0;
                int N = sc.nextInt();
                int K = sc.nextInt();
                for(int i = 1;i<= N;i++){
                	int x = sc.nextInt();
                  	if(x > abs(x - K)){
                      sum = sum + 2 * abs(x-K);
                    }else{
                    	sum = sum + 2 * x;
                    }
                }
                System.out.println(sum);
          		
            }
        }
    }
}

Compiler output:
Main.java:22: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.Scanner;

public class CollectingBalls {
	public static void main(String[] args) {

	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int K = sc.nextInt();
	int[] x = new int[N];
	int[] tmp = new int[N];
	int sum = 0;

	for(int i=0; i<N; i++) {
		x[i] = sc.nextInt();
		tmp[i] = K - x[i];
		if(x[i] < tmp[i]) {
			tmp[i] = x[i];
		}
		sum += tmp[i];
	}

	System.out.println(2*sum);
	}
}

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

#include<stdio.h>
int main() {
int N,K,i;
int array[100];
scanf("%d",&N);
scanf("%d",&K);
for (i=0;i<N-1;i++) {
scanf("%d",&array[i]);
}
int sum;
sum=0;
for (i=0;i<N-1;i++){
if (array[i]<=K/2)
 sum = sum + 2*array[i];
else
 sum sum + 2*(K-array[i]);
}
printf("%d\n",sum);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:5: error: expected ';' before 'sum'
   16 |  sum sum + 2*(K-array[i]);
      |     ^~~~
      |     ;
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {

	int num, k;
	//int *array;
	int y;
	int res = 0;
	int i;

	scanf("%d", &num);
	scanf("%d", &k);

	for (i = 0; i < num; i++) {
		scanf("%d", &y);
		res += min(y * 2, abs(y - k) * 2);

	}

	printf("%d", res);

	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:18:24: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   18 |                 res += min(y * 2, abs(y - k) * 2);
      |                        ^~~
      |                        main
Language: C

#include<stdio.h>
int main() {
int N,K;
int array[100];
scanf("%d",&N);
scanf("%d",&K);
for (i=0;i<N-1;i++) {
scanf("%d",&array[i]);
}
scanf("%d",&A);
int sum;
sum=0;
for (i=0;i<N-1;i++){
if (array[i]<=K/2)
 sum = sum + 2*array[i];
else
 sum sum + 2*(K-array[i]);
}
printf("%d\n",sum);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:6: error: 'i' undeclared (first use in this function)
    7 | for (i=0;i<N-1;i++) {
      |      ^
main.c:7:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:13: error: 'A' undeclared (first use in this function)
   10 | scanf("%d",&A);
      |             ^
main.c:17:5: error: expected ';' before 'sum'
   17 |  sum sum + 2*(K-array[i]);
      |     ^~~~
      |     ;
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#define BIG 100000
int main(void) {
	int N;
//	int head = 1;
//	int a[BIG];
	int K = 0;
	int x = 0;
	int ans=0;
	int tmp = 0;
	scanf_s("%d", &N);
	scanf_s("%d", &K);
	for (int i = 0; i < N; i++) {
		scanf_s("%d", &x);
		tmp = K - x;
		ans += 2*((x > tmp) ? tmp : x);
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   13 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <cstdio>

int main()
{
    int n,k;
    int i,a;
    while(scanf("%d",&n)!=EOF)
    {
        scanf("%d",&k);
        int sum=0;
        for (i=0;i<n;i++)
        {
            scanf("%d",&a)
            if (a<k-a)
                sum+=a;
            else
                sum+=k-a;
        }
        printf("%d\n",sum*2);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: expected ';' before 'if'
   13 |             scanf("%d",&a)
      |                           ^
      |                           ;
   14 |             if (a<k-a)
      |             ~~             
a.cc:16:13: error: 'else' without a previous 'if'
   16 |             else
      |             ^~~~
Language: C++

#include<algorithm>
#include<iostream>

int main(){
  int N; std::cin >> N;
  int K; std::cin >> K;
  auto s = 0;
  for(auto i=0; i<N; ++i){
    int x; std::cin >> x;
    s += min(x, std::abs(K-x));
    s += min(x, std::abs(K-x));
  }
  std::cout << s << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'min' was not declared in this scope; did you mean 'std::min'?
   10 |     s += min(x, std::abs(K-x));
      |          ^~~
      |          std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include<algortihm>
#include<iostream>

int main(){
  int N; std::cin >> N;
  int K; std::cin >> K;
  auto s = 0;
  for(auto i=0; i<N; ++i){
    int x; std::cin >> x;
    s += min(x, std::abs(K-x));
    s += min(x, std::abs(K-x));
  }
  std::cout << s << '\n';
}


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

#include<iostream>

int main(){
  int N; std::cin >> N;
  int K; std::cin >> K;
  auto s = 0;
  for(auto i=0; i<N; ++i){
    int x; std::cin >> x;
    s += min(x, std::abs(K-x));
    s += min(x, std::abs(K-x));
  }
  std::cout << s << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'min' was not declared in this scope; did you mean 'std::min'?
    9 |     s += min(x, std::abs(K-x));
      |          ^~~
      |          std::min
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(String args[]){
    	
      Scanner scan = new Scanner(System.in);
      
      int a = scan.nextInt();
      int b = scan.nextInt();
      int c = scan.nextInt();
      int d = scan.nextInt();
      int e = scan.nextInt();
      int f = scan.nextInt();
      int sugerWater = 0;
      int suger = 0;
      int h = f/(100*a+e)
      while(true){
        if(sugerWater <= f){
          if(e>d){
			
          }else if(e>c){

          }else{

          }
        }
      }
      System.out.println(sugerWater+" "+suger);
    }
}

Compiler output:
Main.java:16: error: ';' expected
      int h = f/(100*a+e)
                         ^
1 error
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String args[]){
    	
      Scanner scan = new Scanner(System.in);
      int a = nextInt();
      int b = nextInt();
      int c = nextInt();
      int d = nextInt();
      int e = nextInt();
      int f = nextInt();
      int sugerWater = 0;
      int suger = 0;
     sugerWater += 100 * a;  
      while(true){
	    if(sugerWater-100*a>e*a){
          if(e>d){
            if(sugerWater <= f){
              sugerWater += d;
              suger += d;
            }
          }else{
              if(e>c){
                  if(sugerWater <= f){
                  sugerWater += c;
                  suger += c;
                  }
              }
          
        
      }
      System.out.println(sugerWater + " " +suger);
    }
}

Compiler output:
Main.java:35: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String args[]){
    	
      Scanner scan = new Scanner(System.in);
      int a = nextInt();
      int b = nextInt();
      int c = nextInt();
      int d = nextInt();
      int e = nextInt();
      int f = nextInt();
      int sugerWater = 0;
      int suger = 0;
     sugerWater += 100 * a;  
      while(true){
	    if(sugerWater-100*a>e*a){
          if(e>d){
            if(sugerWater <= f){
              sugerWater += d;
              suger += d;
            }
          }else{
              if(e>c){
                  if(sugerWater <= f){
                  sugerWater += c;
                  suger += c;
                  }
              }
          }
        
      }
      System.out.println(sugerWater + " " +suger);
    }
}

Compiler output:
Main.java:35: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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

int main(){
  int a, b, c, d; cin >> a >> b >> c >> d;
  int e, f; cin >> e >> f;
  double conc = 0;
  pair<int,int>
  bool flag = true;
  for(int i = 1; i * 100 * a <= f ;i++){
    for(int j = 1; i * 100 * a + j * 100 * b <= f; j++){
      int water = 100 * a * i + 100 * b * j;
      for(int k = 1; water + k * c <= f; k++){
        for(int l = 1; water + k * c + l * d <= f; ++l){
           int salt = k * c + l * d;
           if(c + d > e * (a + b)) break;
           if(conc < (double)(c + d)/(double)100/(double)(a + b)){
             conc = (c+d)/(double)(100 * a + 100 * b); 
             ans.first = c + d + 100 * a + 100 * b;
             ans.second = c + d;
           }
        }
      }
    }
  }
  cout << ans.first << " " << ans.second << endl;
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: two or more data types in declaration of 'flag'
    8 |   pair<int,int>
      |   ^~~~~~~~~~~~~
a.cc:19:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |              ans.first = c + d + 100 * a + 100 * b;
      |              ^~~
      |              abs
a.cc:26:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |   cout << ans.first << " " << ans.second << endl;
      |           ^~~
      |           abs
Language: C++

#include <iostream>

#define Nfori(N) for(int i=0;i<N;i++)
#define Nforj(N) for(int j=0;j<N;j++)
#define Nfork(N) for(int k=0;k<N;k++)
#define Nforl(N) for(int l=0;l<N;l++)
using namespace std;

int main(){
  	int A, B, C, D, E, F;
  	cin >> A >> B >> C >> D >> E >> F;
  	int awater=0;
  	int asugar=0;
  	int afra=0;
  	Nfori(F/(100*A)){
      	Nforj(F/(100*B)){
          	Nfork(F/C){
              	Nforl(F/D){
                  	int water=(i*A+j*B)*100;
                  	int sugar=k*C+l*D;
                  	float fra=sugar/float(water+sugar);
                  	if(water+sugar<=F && fra<=E && afra < fra){
                      	awater=water;
                      	asugar=sugar;
                    }
                }
            }
        }
    }
  	cout << water+sugar << sugar << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: 'water' was not declared in this scope; did you mean 'awater'?
   30 |         cout << water+sugar << sugar << endl;
      |                 ^~~~~
      |                 awater
a.cc:30:23: error: 'sugar' was not declared in this scope; did you mean 'asugar'?
   30 |         cout << water+sugar << sugar << endl;
      |                       ^~~~~
      |                       asugar
Language: C

#include <iostream>
#include <stdio.h>

#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <climits>

using namespace std;


int main() {

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

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

	double condence = 0;
	int sugar = 0;
	int water = 0;

	for (int i = 1; i < (f+(100*a)-1)  / (100*a); i++) {

		for (int j = 0; j < (f + (100 * b) - 1) / (100*b); j++) {

			for (int l = 0; l < f/c; l++) {

				for (int m = 0; m < f/d ; m++) {
					
					if ((c * l + m * d + 100 * a * i + 100 * b * j)> f) {
						break;
					}

					double con = 100 * (c * l + m * d) / (c * l + m * d + 100 * a * i + 100 * b * j);

					if (e * (100 * a * i + 100 * b * j) >= (c * l + m * d) *100 && condence < con) {
						condence = con;
						water = 100 * a * i + 100 * b * j;
						sugar = c * l + d * m;
					}
				}
			}
			
		}
	}

	cout << water + sugar << " " << sugar << 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<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

ll gcd(ll a, ll b) {
  ll v0=a, v1=b, v2=v0%v1;
  while(v2>0) {
    v0 = v1;
    v1 = v2;
    v2 = v0%v1;
  }
  return v1;
}

bool more(ll A, ll B, ll C, ll D) {
  ll yey = gcd(A, C);
  B *= C/yey;
  D *= A/yey;
  if(B<D) return true;
  else return false;
}

int main() {
  ll A, B, C, D, E, F;
  cin>>A>>B>>C>>D>>E>>F;
  ll t, l;
  ll ans1=1, ans2=0;
  for(ll i=0;i*100*A<=F;++i) {
    for(ll j=0;j*100*B<=F;++j) {
      t = 100*A*i+100*B*j;
      if(t==0) continue;
      if(t>F) continue;
      for(ll k=0;100*k*C<=E*t;++k) {
        if(t+C*k>F) continue;
        l = (E*t-100*C*k)/(100*D);
        if(t+C*k+D*l>F) continue;
        if(more(ans1, ans2, t, C*k+D*l)) {
          ans1 = t;
          ans2 = C*k+D*l;
        }
      }
    }
  }
  if(ans==1) cout<<100*A<<" "<<0<<endl;
  else cout<<ans1+ans2<<" "<<ans2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:6: error: 'ans' was not declared in this scope; did you mean 'ans2'?
   65 |   if(ans==1) cout<<100*A<<" "<<0<<endl;
      |      ^~~
      |      ans2
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'salt' was not declared in this scope
    8 |   int water = F; salt = 0;
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int A,B,C,D,E,F;
  int k;
  int l;
  int x[],y[];
  int max[2] = {0,0};
  k=0;
  l=0;
  cin >> A >> B >> C >> E >> F;
  for(int i=0;i<F;i++){
    for(int j=0;j<F;j++){
      x[k] = (i*A+j*B)*100;
      k++;
    }
  }
  for(int i=0;i<F;i++){
    for(int j=0;j<F;j++){
      y[l] = i*C+j*D;
      l++;
    }
  }
  for(int i=0;i<k;i++){
    for(int j=0;j<l;j++){
      if(x[i]+y[j]<F){
        if((max[1]*100)/(max[0]+max[1])<(y[j]*100)/(x[i]+y[j])){
          max[0]=x[i];
          max[1]=y[j];
        }
      }
    }
  }
  cout << max[0] << max[1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: storage size of 'x' isn't known
    7 |   int x[],y[];
      |       ^
a.cc:7:11: error: storage size of 'y' isn't known
    7 |   int x[],y[];
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int A,B,C,D,E,F;
  int k
  int l
  int x[F*F],y[F*F];
  int max[2] = {0,0};
  k=0;
  l=0;
  cin >> A >> B >> C >> E >> F;
  for(int i=0;i<F;i++){
    for(int j=0;j<F;j++){
      x[k] = (i*A+j*B)*100;
      k++;
    }
  }
  for(int i=0;i<F;i++){
    for(int j=0;j<F;j++){
      y[l] = i*C+j*D;
      l++;
    }
  }
  for(int i=0;i<k;i++){
    for(int j=0;j<l;j++){
      if(x[i]+y[j]<F){
        if((max[1]*100)/(max[0]+max[1])<(y[j]*100)/(x[i]+y[j])){
          max[0]=x[i];
          max[1]=y[j];
        }
      }
    }
  }
  cout << max[0] << max[1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'int'
    6 |   int l
      |   ^~~
a.cc:9:3: error: 'k' was not declared in this scope
    9 |   k=0;
      |   ^
a.cc:10:3: error: 'l' was not declared in this scope
   10 |   l=0;
      |   ^
a.cc:14:7: error: 'x' was not declared in this scope
   14 |       x[k] = (i*A+j*B)*100;
      |       ^
a.cc:20:7: error: 'y' was not declared in this scope
   20 |       y[l] = i*C+j*D;
      |       ^
a.cc:26:10: error: 'x' was not declared in this scope
   26 |       if(x[i]+y[j]<F){
      |          ^
a.cc:26:15: error: 'y' was not declared in this scope
   26 |       if(x[i]+y[j]<F){
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int A,B,C,D,E,F;
  int x[F*F],y[F*F];
  int max[2]
  int k=0;
  max[0]=0;
  max[1]=0;
  cin >> A >> B >> C >> E >> F;
  for(int i=0;i<F;i++){
    for(int j=0;j<F;j++){
      x[k] = (i*A+j*B)*100;
      k++;
    }
  }
  for(int i=0;i<F;i++){
    for(int j=0;j<F;j++){
      y[l] = i*C+j*D;
      l++;
    }
  }
  for(int i=0;i<k;i++){
    for(int j=0;j<l;j++){
      if(x[i]+y[j]<F){
        if((max[1]*100)/(max[0]+max[1])<(y[j]*100)/(x[i]+y[j])){
          max[0]=x[i];
          max[1]=y[j];
        }
      }
    }
  }
  cout << max[0] << max[1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'int'
    7 |   int k=0;
      |   ^~~
a.cc:8:6: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    8 |   max[0]=0;
      |      ^
a.cc:9:6: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    9 |   max[1]=0;
      |      ^
a.cc:13:9: error: 'k' was not declared in this scope
   13 |       x[k] = (i*A+j*B)*100;
      |         ^
a.cc:19:9: error: 'l' was not declared in this scope
   19 |       y[l] = i*C+j*D;
      |         ^
a.cc:23:17: error: 'k' was not declared in this scope
   23 |   for(int i=0;i<k;i++){
      |                 ^
a.cc:24:19: error: 'l' was not declared in this scope
   24 |     for(int j=0;j<l;j++){
      |                   ^
a.cc:26:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   26 |         if((max[1]*100)/(max[0]+max[1])<(y[j]*100)/(x[i]+y[j])){
      |                ^
a.cc:26:29: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   26 |         if((max[1]*100)/(max[0]+max[1])<(y[j]*100)/(x[i]+y[j])){
      |                             ^
a.cc:26:36: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   26 |         if((max[1]*100)/(max[0]+max[1])<(y[j]*100)/(x[i]+y[j])){
      |                                    ^
a.cc:27:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   27 |           max[0]=x[i];
      |              ^
a.cc:28:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   28 |           max[1]=y[j];
      |              ^
a.cc:33:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   33 |   cout << max[0] << max[1] << endl;
      |              ^
a.cc:33:24: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   33 |   cout << max[0] << max[1] << endl;
      |                        ^
Language: C++

/**
 *    author:  FromDihPout
 *    created: 2020-08-05
**/

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


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    cout << 100 * w1 << ' ' << 0 << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: 'w1' was not declared in this scope; did you mean 'y1'?
   16 |     cout << 100 * w1 << ' ' << 0 << '\n';
      |                   ^~
      |                   y1
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	int a,b,c,d,e,f;
	int maxs=0,maxsl=0,svf=0
	double base=0;
	cin>>a>>b>>c>>d>>e>>f;
	for(int i=0;i<=f/(100*a)+1;i++)
	{
		for(int j=0;j<=f/(100*b)+1;j++)
		{
			for(int k=0;k<=f/c+1;k++)
			{
				for(int l=0;l<=f/d+1;l++)
				{

					double sol = k*c + l*d;
					double sv = 100*(a*i+b*j);

					if(sol+sv<=(double)f && !(i+j==0) && sol<=((a*i+b*j)*e))
					{
						if(base<=sol/sv)
						{
							base=sol+sv;
							maxs=100*(a*i+b*j)+k*c+l*d;
							mxsl=k*c+l*d;
						}
					}
				}
			}
		}
	}
	cout<<(long long)maxs<<" "<<(long long)maxsl<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected ',' or ';' before 'double'
    8 |         double base=0;
      |         ^~~~~~
a.cc:24:52: error: 'base' was not declared in this scope
   24 |                                                 if(base<=sol/sv)
      |                                                    ^~~~
a.cc:28:57: error: 'mxsl' was not declared in this scope; did you mean 'maxsl'?
   28 |                                                         mxsl=k*c+l*d;
      |                                                         ^~~~
      |                                                         maxsl
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,f;

int main(){
    cin >> a >> b >> c >> d >> e >> f;
    int a_wat=0; int b_wat=0;
    int c_su=0; int d_sug=0;
    int ans_w=100; int ans_s=0;
    while(a_wat<f){
        b_wat=0;
        while(a_wat+b_wat<f){
            c_sug=0;
            if(a_wat==0)b_wat+=b*100;
            while(a_wat+b_wat+c_sug<f){
                d_sug=0;
                while(a_wat+b_wat+c_sug+d_sug<f && (c_sug+d_sug)*100<=(a_wat+b_wat)*e){
                    if((c_sug+d_sug)*100==(a_wat+b_wat)*e){
                        cout << a_wat+b_wat+c_sug+d_sug << " " << c_sug+d_sug;
                        return 0;
                    }
                    else if((c_sug+d_sug)*ans_w>=(a_wat+b_wat)*ans_s){
                        ans_w=a_wat+b_wat;
                        ans_s=c_sug+d_sug;
                    }
                    d_sug+=d;
                }
                c_sug+=c;
            }
            b_wat+=b*100;
        }
        a_wat+=a*100;
    }
    cout << ans_w+ans_s << " " << ans_s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'c_sug' was not declared in this scope; did you mean 'd_sug'?
   13 |             c_sug=0;
      |             ^~~~~
      |             d_sug
Language: C++

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

int main() {
  int a,b,c,d,e,f;
  cin >>a>>b>>c>>d>>e>>f;
  P ans=P(100*a,0);
  double co=0;
  vector<int>s,w;
  rep(i,f+1){
    rep(j,f+1){
      int now=c*i+d*j;
      if(now<f){
        s.push_back(now);
      }
    }
  }
  rep2(i,f+1){
    rep(j,f+1){
      int now=100*a*i+100*b*j;
      if(now<f){
        w.push_back(now);
      }
    }
  }
  rep(i,s.size()){
    rep(j,w.size()){
      if(s[i]+w[j]<f&&s[i]*100<=w[j]*e){
        if(co<(double)s[i]/w[j]){
          ans=P(w[j],s[i]);
          co=(double)s[i]/w[j];
        }
      }
    }
  }
        
      
  cout<<ans.first+ans.second<<" "<<ans.second<<endl;
}

Compiler output:
a.cc:22:13: error: macro "rep2" requires 3 arguments, but only 2 given
   22 |   rep2(i,f+1){
      |             ^
a.cc:4:9: note: macro "rep2" defined here
    4 | #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
      |         ^~~~
a.cc: In function 'int main()':
a.cc:22:3: error: 'rep2' was not declared in this scope
   22 |   rep2(i,f+1){
      |   ^~~~
Language: C++

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

bool sugar(int x,int y,int z){
  int i=0;
  while(x*i<=z){
    if((z-x*i)%y==0) return true;
    i++;
  }
  return false;
}

int main() {
  int A,B,C,D,E,F;
  cin >> A >> B >> C >> D >> E >> F;
  int best_noudo=0;
  int best_whole=0;
  int best_sugar=0;
  vector(int)water;
  for(int i=0;i<31;i++){
    for(int j=0;j<31;j++){
      int x=A*i+B*j;
      if(x*100<=F&&x!=0) water.push_back(x);
    }
  }
  int w=water.size();
  for(int i=0;i<w;i++){
    int x=water.at(i);
    int j=x*E;
    double data=0;
    while(true){
      if(100*x+j<F&&sugar(C,D,j)){
        data=j;
        break;
      }
      j--;
    }
    if(best_noudo<data/x){
      best_whole=100*x+data;
      best_sugar=data;
    }
  }
  cout << best_whole << " " << best_sugar << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: missing template arguments before '(' token
   19 |   vector(int)water;
      |         ^
a.cc:19:10: error: expected primary-expression before 'int'
   19 |   vector(int)water;
      |          ^~~
a.cc:23:26: error: 'water' was not declared in this scope
   23 |       if(x*100<=F&&x!=0) water.push_back(x);
      |                          ^~~~~
a.cc:26:9: error: 'water' was not declared in this scope
   26 |   int w=water.size();
      |         ^~~~~
Language: C++

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

int main(){
    int a,b,c,d,e,f;
    cin >> a >> b >> c >> d >> e >> f;
    ll w,w2,w3;
    double g,h;
    ll ans1=-1,ans2=0;
    h=0; 
    rep(i,30){
        rep(j,30){
            w=100*a*i+100*b*j;
            
            if(w<100*a or w>f){
                continue;
            }
            
            else{
                rep(i2,3000){
                    //ans1=w;
                    if((w+d*i2)>f){
                        break;
                    }
                    else if(d*i2>e*(w/100)){
                        break;
                    }
                    else{
                        w3=((e*(w/100)-d*i2)/c)*c+d*i2;
                        w2=w3+w;
                        //cout << i << " " << j << " " << w3 << " " << w2 << endl;
                         if(w2>f){
                             if((w2-f)%c!=0){
                            w3-=((w2-f)/c+1)*c;
                            w2-=((w2-f)/c+1)*c;
                             }
                             else{
                                 w3-=w2-f;
                                 w2-=w2-f;
                             }
                            
                        }
                        //cout << i << " " << j << " " << w3 << " " << w2 << endl;

                        g=w3/double(a*i+b*j);
                        if(g>h){
                            h=g;
                            ans1=w+w3;
                            ans2=ans1-w;
                        }
                    }
                }
            }
        }
    }
    if(ans==-1){
        ans1=0;
    }

    cout << ans1 <<" " <<  ans2 << endl;
    

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:8: error: 'ans' was not declared in this scope; did you mean 'ans2'?
   59 |     if(ans==-1){
      |        ^~~
      |        ans2
Language: C++

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

int main(){
    int a,b,c,d,e,f;
    cin >> a >> b >> c >> d >> e >> f;
    ll w,w2,w3;
    double g,h;
    ll ans1,ans2;
    h=0; 
    rep(i,30){
        rep(j,30){
            w=100*a*i+100*b*j;
            if(w<100*a or w>f){
                continue;
            }
            else{
                rep(i2,3000){
                    if((w+d*i2)>f){
                        break;
                    }
                    else if(d*i2>e*(w/100)){
                        break;
                    }
                    else{
                        w3=((e*(w/100)-d*i2)/c)*c+d*i2;
                        w2=w3+w;
                        //cout << i << " " << j << " " << w3 << " " << w2 << endl;
                         if(w2>f){
                             if((w2-f)%c!0){
                            w3-=((w2-f)/c+1)*c;
                            w2-=((w2-f)/c+1)*c;
                             }
                             else{
                                 w3-=w2-f;
                                 w2-=w2-f;
                             }
                            
                        }
                        //cout << i << " " << j << " " << w3 << " " << w2 << endl;

                        g=w3/double(a*i+b*j);
                        if(g>h){
                            h=g;
                            ans1=w+w3;
                            ans2=ans1-w;
                        }
                    }
                }
            }
        }
    }

    cout << ans1 <<" " <<  ans2 << endl;
    

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:41: error: expected ')' before '!' token
   33 |                              if((w2-f)%c!0){
      |                                ~        ^
      |                                         )
Language: C++


// C - Sugar Water

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

const int MAX = 4000;
bool dp[MAX][MAX]; // dp[a][b]: 水i(g), 砂糖j(g)の組み合わせがあれば1

int main() {
	int A, B, C, D, E, F;
	cin >> A >> B >> C >> D >> E >> F;

	set<int> water;
	set<int> sugar;

	for (int i=0; i*100*A<=F; i++) {
		for (int j=0; j*100*B<=F; j++) {
			if ((i*100*A + j*100*B != 0) && (i*100*A + j*100*B <= F)) {
				water.insert(i*100*A + j*100*B);
			}
		}
	}

	for (int i=0; i*C<=F; i++) {
		for (int j=0; j*D<=F; j++) {
			if (i*C + j*D <= F) {
				sugar.insert(i*C + j*D);
			}
		}
	}

	int ans_w = 100*A
	int ans_s = 0;
	for (int w : water) {
		for (int s : sugar) {
			if (s * (100 + E) > E * (w + s)) continue;
			if (w + s > F) continue;

			if (s * (ans_w + ans_s) > ans_s * (w + s)) {
				ans_w = w;
				ans_s = s;
			}
		}
	}

	cout << ans_w + ans_s << " " << ans_s << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: expected ',' or ';' before 'int'
   38 |         int ans_s = 0;
      |         ^~~
a.cc:44:42: error: 'ans_s' was not declared in this scope; did you mean 'ans_w'?
   44 |                         if (s * (ans_w + ans_s) > ans_s * (w + s)) {
      |                                          ^~~~~
      |                                          ans_w
a.cc:51:25: error: 'ans_s' was not declared in this scope; did you mean 'ans_w'?
   51 |         cout << ans_w + ans_s << " " << ans_s << endl;
      |                         ^~~~~
      |                         ans_w
Language: C++

#include <iostream>
using namespace std;

int main(){
  int a,b,c,d,e,f;
  cin>>a>>b>>c>>d>>e>>f;
  int water;
  int solt;
  int watermax;
  int soltmax;
  double per=0;
  for(int i=0;100*a*i<=f;i++){
    for(int j=0;100*a*i+100*b*j<=f;j++){
      water=100*a*i+100*b*j;
      for(int k=0;100*a*i+100*b*j+c*k<=f;k++){
        for(int l=0;100*a*i+100*b*j+c*k+d*l<=f;l++){
          solt=c*k+d*l;
          /*塩が溶ける条件と濃度％*/
          if(water!=0){
           if(e*water>=100*solt and per<=solt*10000/(water+solt)){
             /*最大濃度、その時の水質量、食塩の更新*/
              per=solt*10000/(water+solt);
              watermax=water;
              soltmax=solt;
             
           }else{
             watermax=water;
             solt=0;
              
          }
        }
      }
    }
  }
  /*濃度最大時の水質量と塩マックスを出力*/
  cout<<watermax+soltmax<<endl;
  cout<<soltmax<<endl;
}
                 
           


  


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

#include <iostream>
using namespace std;

int main(){
  int a,b,c,d,e,f;
  cin>>a>>b>>c>>d>>e>>f;
  int water;
  int solt;
  int watermax;
  int soltmax;
  double per=0;
  for(int i=0;100*a*i<=f;i++){
    for(int j=0;100*a*i+100*b*j<=f;j++){
      water=100*a*i+100*b*j;
      for(int k=0;100*a*i+100*b*j+c*k<=f;k++){
        for(int l=0;100*a*i+100*b*j+c*k+d*l<=f;l++){
          solt=c*k+d*l;
          /*塩が溶ける条件と濃度％*/
          if(water!=0 and solt!=0){
           if(e*water>=100*solt and per<=solt*10000/(water+solt)){
             /*最大濃度、その時の水質量、食塩の更新*/
              per=solt*10000/(water+solt);
              watermax=water;
              soltmax=solt;
             
           }
              
          }else{
            water=100*a;
            solt=0;
        }
      }
    }
  }
  /*濃度最大時の水質量と塩マックスを出力*/
  cout<<watermax+soltmax<<endl;
  cout<<soltmax<<endl;
}
                 
           


  


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

#include <iostream>
using namespace std;

int main(){
  int a,b,c,d,e,f;
  cin>>a,b,c,d,e,f;
  
  int x;
  int xmax,ymax;
  double per=0;
  
  for(int i=0;100*a*i<=f;i++){
    for(int j=0;100*a*i+100*b*j<=f;j++){
      x=100*a*i+100*b*j;
      for(int k=0;x+c*k<=f;k++){
        for(int l=0;x+c*k+d*l;l++){
          y=c*k+d*l;
          if(x*e>=100*y and per<(double)(y/(x+y))){
            per=(double)(y/(x+y));
            xmax=x;
            ymax=y;
          }
          
        }
      }
    }
  }
  cout<<xmax<<endl;
  cout<<ymax<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: 'y' was not declared in this scope
   17 |           y=c*k+d*l;
      |           ^
Language: C++

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

int main() {
  int a, b, c, d, e, f, p, q; long double l = 0; scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
  rep(i, f/100+1){
    bool g = 0;
    rep(j, (i+1)/b+1){
      if(i+1-jb >= 0 && (i+1-j*b)%a == 0){
        g = 1;
        break;
      }
    }
    if(g){
      rep(j, min((i+1)*e+1, f-i*100-100+1)){
        bool h = 0;
        rep(k, j/d+1){
          if(j-k*d >= 0 && (j-k*d)%c == 0){
            h = 1;
            break;
          }
        }
        if(h && l < (j+0.0)/(i+1)){
          p = (i+1)*100;
          q = j;
          l = (j+0.0)/(i+1);
          if(l == e) break;
        }
      }
    }
  }
  printf("%d %d\n", p+q, q);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'jb' was not declared in this scope; did you mean 'j'?
   10 |       if(i+1-jb >= 0 && (i+1-j*b)%a == 0){
      |              ^~
      |              j