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

#define _CRT_SECURE_NO_WARNINGS

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

int main(void)
{
	int n, k;
	cin >> n >> k;

	int *w = new int[n], sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> w[i];
		sum += w[i];
	}
	int p = sum / k;
	
	while (!judge(w, n, k, p)) p++;
	
	cout << p;

	return 0;
}

bool judge(const int w[], int n, int k, int p)
{
	int t[100000] = {0};
	int j = 0;
	for (int i = 0; i < n; i++) {
		if (p - t[j] < w[i]) j++;
		if (j >= k) return false;
		t[j] += w[i];
	}
	return true;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'judge' was not declared in this scope
   19 |         while (!judge(w, n, k, p)) p++;
      |                 ^~~~~
Language: C++

#define dbg(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#define dpri(x) dbg(#x ": %d\n", x)
#define dprs(x) dbg(#x ": %s\n", x)
#include <stdio.h>
typedef long long ll;
const int MYINF = 1e9+7;
typedef int bool;
bool true = 1;
bool false = 0;
 
int n, k;
int w[100010];
 
bool check(int capa) {
    int i, j, c;
    for (i = 0, j = 0; j < k; j++) {
        c = capa;
        while ((c - w[i]) >= 0) {
            c -= w[i];
            i++;
            if (i == n) {
                return true;
            }
        }
    }
    if (i == n) return true;
    return false;
}
 
int search(int l, int r) {
    int i, m;
    if (r - l < 5) {
        for (i = l - 1; i <= r + 1; i++) {
            if (check(i)) return i;
        }
    }
    m = (l + r) / 2;
    if (check(m)) {
        return search(l, m - 1);
    } else {
        return search(m + 1, r);
    }
}
 
int main(int argc, char **argv)
{
    int i, maxw, pd, d;
    scanf("%d %d", &n, &k);
    maxw = -1;
    for (i = 0; i < n; i++) {
        scanf("%d", &w[i]);
        if (maxw < w[i]) maxw = w[i];
    }
 
    if (k >= n) {
        printf("%d\n", maxw);
        return 0;
    }
 
    for (pd = d = maxw; !check(d); pd = d, d *= 2)
        ;
    printf("%d\n", search(pd, d));
 
    return 0;
}

Compiler output:
a.cc:7:13: error: redeclaration of C++ built-in type 'bool' [-fpermissive]
    7 | typedef int bool;
      |             ^~~~
a.cc:8:6: error: expected unqualified-id before 'true'
    8 | bool true = 1;
      |      ^~~~
a.cc:9:6: error: expected unqualified-id before 'false'
    9 | bool false = 0;
      |      ^~~~~
Language: C++

#include<iostream>
#include<climits>
int solve(void);
int check(int);
int n, k;
int main(){
  std::cin >> n >> k;
  int W[n];
  for(int i=0; i<n; i++) std::cin >> W[i];
  std::cout << solve() << std::endl;
  return 0;
}
int solve(){
  int l=0, r=INT_MAX, m;
  while(r-l>1){
    m = (r + l) / 2;
    int v = check(m);
    v >= n ? r = m : l = m;
  }
  return r;
}
int check(int *W,int p){
  int i=0;
  for(int j=0; j<k; j++){
    int s=0;
    while(s+W[i] <= p){
      s += W[i];
      i++;
      if(i == n) return n;
    }
  }
  return i;
}

Compiler output:
/usr/bin/ld: /tmp/cci0b9pd.o: in function `solve()':
a.cc:(.text+0x131): undefined reference to `check(int)'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
#define MAX 100000
typedef long long llong;
int n,k;
llong T[MAX];
int check(llong p)
{
    int i=0;
    for(int j=0;j<k;j++)
    {
        llong s=0;
        while(s+T[i]<=p)
        {
            s+=T[i];
            i++;
            if(i==n) return n;
        }
    }
    return i;
}
int solve()
{
    llong left=0;
    llong right=100000*10000；
    llong mid;
    while(right-left>1)
    {
        mid=(left+right)/2;
        int v=check(mid);
        if(v>=n) right=mid;
        else left=mid;
    }
    return right;
}
int main()
{
    cin>>n>>k;
    for(int i=0;i<n;i++)
        cin>>T[i];
    llong ans=solve();
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:25:24: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   25 |     llong right=100000*10000；
      |                        ^~~~~~~
a.cc:29:9: error: 'mid' was not declared in this scope
   29 |         mid=(left+right)/2;
      |         ^~~
Language: C++

w[100000],n,k;
cntp(int p)
{
    int cnt=1,wgh=0;
    for(int i=0;i<n;)
    {
        if(wgh+w[i]<=p)
        {
            wgh+=w[i++];
        }
        else
        {
            if(wgh>0)cnt++;
            else return k+1; 
            wgh=0;
        }
    }
    return cnt;
}
main()
{
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;scanf("%d",w+i++));
    int l=0,r=1e9,m;
    while(l<r)
    {
        m=(l+r)/2;
        if(cntp(m)>k)l=m+1;
        else r=m;
    }
    for(m--;;m++)
    {
        if(cntp(m)<=k)break;
    }
    printf("%d\n",m);
    return 0;
}

Compiler output:
a.cc:1:1: error: 'w' does not name a type
    1 | w[100000],n,k;
      | ^
a.cc:2:1: error: ISO C++ forbids declaration of 'cntp' with no type [-fpermissive]
    2 | cntp(int p)
      | ^~~~
a.cc: In function 'int cntp(int)':
a.cc:5:19: error: 'n' was not declared in this scope
    5 |     for(int i=0;i<n;)
      |                   ^
a.cc:7:16: error: 'w' was not declared in this scope
    7 |         if(wgh+w[i]<=p)
      |                ^
a.cc:14:25: error: 'k' was not declared in this scope
   14 |             else return k+1;
      |                         ^
a.cc: At global scope:
a.cc:20:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   20 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:22:19: error: 'n' was not declared in this scope
   22 |     scanf("%d%d",&n,&k);
      |                   ^
a.cc:22:22: error: 'k' was not declared in this scope
   22 |     scanf("%d%d",&n,&k);
      |                      ^
a.cc:22:5: error: 'scanf' was not declared in this scope
   22 |     scanf("%d%d",&n,&k);
      |     ^~~~~
a.cc:23:32: error: 'w' was not declared in this scope
   23 |     for(int i=0;i<n;scanf("%d",w+i++));
      |                                ^
a.cc:35:5: error: 'printf' was not declared in this scope
   35 |     printf("%d\n",m);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | w[100000],n,k;
Language: C++

#include <cstdio>
#include <iostream>
#define MAX 100000;
using namespace std;
typedef long long llong;
int n,k;
llong T[MAX];
int check(llong P){
  int i=0;
  for(j=0;j<k;j++){
    llong s=0;
    while(s+T[i]<=P){
      s+=T[i++];
      if(i==n)return n;
    }
  }
  return i;
}
int solve(){
  llong left=0;
  llong right=MAX*10000;
  llong mid;
  while(left<right){
    mid=(left+right)/2;
    int v=check(mid);
    if(v>=n)right=mid;
    else left=mid;
  }
}
int main(){
  scanf("%d %d",&n,&k);
  for(int i=0;i<n;i++)scanf("%d",&T[i]);
  llong ans=solve();
  printf("%d\n",ans);
  return 0;
}

Compiler output:
a.cc:3:19: error: expected ']' before ';' token
    3 | #define MAX 100000;
      |                   ^
a.cc:7:9: note: in expansion of macro 'MAX'
    7 | llong T[MAX];
      |         ^~~
a.cc:7:12: error: expected unqualified-id before ']' token
    7 | llong T[MAX];
      |            ^
a.cc: In function 'int check(llong)':
a.cc:10:7: error: 'j' was not declared in this scope
   10 |   for(j=0;j<k;j++){
      |       ^
a.cc:12:13: error: 'T' was not declared in this scope
   12 |     while(s+T[i]<=P){
      |             ^
a.cc: In function 'int solve()':
a.cc:21:18: error: invalid type argument of unary '*' (have 'int')
   21 |   llong right=MAX*10000;
      |                  ^~~~~~
a.cc:29:1: warning: no return statement in function returning non-void [-Wreturn-type]
   29 | }
      | ^
a.cc: In function 'int main()':
a.cc:32:35: error: 'T' was not declared in this scope
   32 |   for(int i=0;i<n;i++)scanf("%d",&T[i]);
      |                                   ^
Language: C++

include<cstdio>
 
#define MAX_N 100000
#define MAX_K 100000
#define MAX_W 10000
 
using namespace std;
 
int w[MAX_N];
 
int check(int n, int k, int p)
{
    int i = 0;;
    for (int j = 0; j < k; j++) {
        int sum = 0;
        while (sum + w[i] < p) {
            sum += w[i];
            i++;
            if (i >= n) return n;
        }
    }
    return i;
}
 
int main()
{
    int n, k;
    scanf("%d %d", &n, &k);
    for (int i = 0; i < n; i++) {
        scanf("%d", &w[i]);
    }
 
    long long left = 0;
    long long right = n * MAX_W;
    long long mid;
    while (left < right) {
        mid = (left + right) / 2;
        int v = check(n, k, mid);
        if (v >= n) right = mid;
        else left = mid + 1;
    }
    printf("%d\n", right - 1);
 
    return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<cstdio>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:28:5: error: 'scanf' was not declared in this scope
   28 |     scanf("%d %d", &n, &k);
      |     ^~~~~
a.cc:42:5: error: 'printf' was not declared in this scope
   42 |     printf("%d\n", right - 1);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include<cstdio>
Language: C++


include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
 
using namespace std;
 
typedef pair<int,int>P;
 
const int MAX_N = 100000;
int w[MAX_N];
 
 
bool possible(ll P,int n,int k)
{
    ll nsum=0;
    int pos=0;
    int i=0;
    while(i < k && pos < n){
        if(nsum + w[pos] <= P){
            nsum += w[pos];
            pos++;
        }else{
            nsum=0;
            i++;
        }   
    }
    if(i < k){
        return true;
    }else{
        return false;
    }
}
 
int main()
{
    int n,k;
    int maxw=0,sumw=0;
    cin >> n >> k;
    for(int i=0;i<n;i++){
        scanf("%d",&w[i]);
        maxw = max(maxw,w[i]);
        sumw += w[i];
    }
    ll high = (ll)maxw*n/k+1; //??????true
    ll low = sumw/k-1; //??????false
    //true???¨???????????°????P????????????¢??´?¢???§??±???????
    while(1){
        ll mid = (high+low)/2;
        if(mid == low){
            break;
        }
        if(possible(mid,n,k)){
            high = mid;
        }else{
            low = mid;
        }
    }
    cout << high << "\n";
}
 

 

Compiler output:
a.cc:2:1: error: 'include' does not name a type
    2 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:10:9: error: 'pair' does not name a type
   10 | typedef pair<int,int>P;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:41:5: error: 'cin' was not declared in this scope
   41 |     cin >> n >> k;
      |     ^~~
a.cc:43:9: error: 'scanf' was not declared in this scope
   43 |         scanf("%d",&w[i]);
      |         ^~~~~
a.cc:44:16: error: 'max' was not declared in this scope; did you mean 'maxw'?
   44 |         maxw = max(maxw,w[i]);
      |                ^~~
      |                maxw
a.cc:61:5: error: 'cout' was not declared in this scope
   61 |     cout << high << "\n";
      |     ^~~~
Language: C++

include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
 
using namespace std;
 
typedef pair<int,int>P;
 
const int MAX_N = 100000;
int w[MAX_N];
 
 
bool possible(ll P,int n,int k)
{
    ll nsum=0;
    int pos=0;
    int i=0;
    while(i < k && pos < n){
        if(nsum + w[pos] <= P){
            nsum += w[pos];
            pos++;
        }else{
            nsum=0;
            i++;
        }   
    }
    if(i < k){
        return true;
    }else{
        return false;
    }
}
 
int main()
{
    int n,k;
    int maxw=0,sumw=0;
    cin >> n >> k;
    for(int i=0;i<n;i++){
        scanf("%d",&w[i]);
        maxw = max(maxw,w[i]);
        sumw += w[i];
    }
    ll high = (ll)maxw*n/k+1; //??????true
    ll low = sumw/k-1; 
    while(1){
        ll mid = (high+low)/2;
        if(mid == low){
            break;
        }
        if(possible(mid,n,k)){
            high = mid;
        }else{
            low = mid;
        }
    }
    cout << high << "\n";
}
 

 

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:9:9: error: 'pair' does not name a type
    9 | typedef pair<int,int>P;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:40:5: error: 'cin' was not declared in this scope
   40 |     cin >> n >> k;
      |     ^~~
a.cc:42:9: error: 'scanf' was not declared in this scope
   42 |         scanf("%d",&w[i]);
      |         ^~~~~
a.cc:43:16: error: 'max' was not declared in this scope; did you mean 'maxw'?
   43 |         maxw = max(maxw,w[i]);
      |                ^~~
      |                maxw
a.cc:59:5: error: 'cout' was not declared in this scope
   59 |     cout << high << "\n";
      |     ^~~~
Language: C++

#include <iostream>

using namespace std;

#define MAX_N 100000
#define MAX_K 100000
#define MAX_W 10000
typedef long long llong;

int n, k;
llong T[MAX];

//k????????§????????????P?????????????£?????°??´§??????
int check(llong P)
{
	int i = 0;
	for (int j = 0; j < k; j++) {
		llong s = 0;
		while (s + T[i] <= P) {
			s += T[i];
			i++;
			if (i == n) return n;
		}
	}
	return i;
}

int solve()
{
	llong left = 0;
	llong right = MAX_K * MAX_W; // ?´§?????° * 1??¶?´§???????????§??????
	llong mid;
	while ((right - left) > 1) {
		mid = (left + right) / 2;
		int v = check(mid); // mid == ?£???\mid == P??¶????£?????°??´§???
		if (v >= n) right = mid;
		else left = mid;
	}
	
	return right;
}

void main()
{
	cin >> n >> k;
	for (int i = 0; i < n; i++) cin >> T[i];
	llong ans = solve();
	cout << ans << endl;
}

Compiler output:
a.cc:11:9: error: 'MAX' was not declared in this scope; did you mean 'MAX_N'?
   11 | llong T[MAX];
      |         ^~~
      |         MAX_N
a.cc: In function 'int check(llong)':
a.cc:19:28: error: 'T' was not declared in this scope
   19 |                 while (s + T[i] <= P) {
      |                            ^
a.cc: At global scope:
a.cc:43:1: error: '::main' must return 'int'
   43 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:46:44: error: 'T' was not declared in this scope
   46 |         for (int i = 0; i < n; i++) cin >> T[i];
      |                                            ^
Language: C++

#include<iostream>
using namespace std;
#define MAX 100000
typedef long long llong;

int n, k;
llong T[MAX];

// 最大積載量 P の k 台のトラックで何個の荷物を積めるか？
int check(llong P) {
  int i = 0;
  for ( int j = 0; j < k; j++ ) {
    llong s = 0;
    while( s + T[i] <= p) {
      s += T[i];
      i++;
      if ( i == n ) return n;
    }
  }
  return i;
}

int solve() {
  llong left = 0;
  llong right = 100000 * 10000;  // 荷物の個数 x 1個当たりの最大重量
  llong mid;
  while ( right - left > 1 ) {
    mid = (left + right) / 2;
    int v = check(mid);  // mid == P を決めて何個積めるかチェック
    if ( v >= n ) right = mid;
    else left = mid;
  }

  return right;
}

main() {
  cin >> n >> k;
  for ( int i = 0; i < n; i++ ) cin >> T[i];
  llong ans = solve();
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int check(llong)':
a.cc:14:24: error: 'p' was not declared in this scope
   14 |     while( s + T[i] <= p) {
      |                        ^
a.cc: At global scope:
a.cc:37:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   37 | main() {
      | ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<stdlib.h>
#include<algorithm>
#include<math.h>
#include<stack>
#include<string.h>
#include<cstring>
#define M 10000005

using namespace std;

int N = 0;
char a[M][12];
int h1(int k) { return k%M; }
int h2(int k) { return 1 + k % (M - 1); }
int getc(char c)
{
	if (c == 'A') return 1;
	else if (c == 'C') return 2;
	else if (c == 'G') return 3;
	else if (c == 'T') return 4;
	return 0;
}

void insert(char s[])
{
	int k = 0;
	int t = 1;

	for (int i = 0; i < strlen(s); i++)
	{
		k = k + t*getc(s[i]);
		t += 5;
	}

	for (int i = 0; ; i++)
	{
		int t = h1(k) + i*h2(k);
		if (strcmp(a[t],s)==0)
			return;
		else if (strlen(a[t]) == 0)
		{
			strcpy_s(a[t], s);
			return;
		}
	}
}

int find(char s[])
{
	int k = 0;
	int t = 1;
	for (int i = 0; i < strlen(s); i++)
	{
		k = k + t*getc(s[i]);
		t += 5;
	}

	for (int i = 0; ; i++)
	{
		int t = h1(k) + i*h2(k);
		if (strlen(a[t]) == 0)
		{
			return 0;
		}
		else if (strcmp(a[t],s)==0)
			return 1;

	}
}

int main()
{
	cin >> N;
	char s1[12], s2[12];
	for (int i = 0; i < N; i++)
	{
		cin >> s1 >> s2;
		if (s1[0] == 'i')
			insert(s2);
		else
		{
			if (find(s2))
				cout << "yes" << endl;
			else
				cout << "no" << endl;
		}

	}
	return 0;

}


Compiler output:
a.cc: In function 'void insert(char*)':
a.cc:44:25: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
   44 |                         strcpy_s(a[t], s);
      |                         ^~~~~~~~
      |                         strcpy
Language: C++

#include <utility>
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
typedef long long ll;
#define n_MAX 100000;
#define w_MAX 10000;
using namespace std;

int n,k;
ll T[n_MAX];

// 積載量 P で積める荷物量
int check(ll P){
  int i=0;
  for (size_t j = 0; j < k; j++) {
    ll s=0;
    while (s+T[i]<=P) {
      s += T[i];
      i++;
      if (i==n) return n; // 全て積めた
    }
  }
  return i;
}

int solve(){
  ll left = 0;
  ll right = n_MAX * w_MAX;
  ll mid;
  while (right - left > 1) {
    mid = (left + right) / 2;
    int v = check(mid);
    if (v >= n) right = mid;
    else left = mid;
  }
  return right;
}

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

  std::cin >> n >> k;

  for (size_t i = 0; i < n; i++) std::cin >> T[i];

  ll ans = solve();

  std::cout << ans << '\n';

  return 0;
}



Compiler output:
a.cc:11:21: error: expected ']' before ';' token
   11 | #define n_MAX 100000;
      |                     ^
a.cc:16:6: note: in expansion of macro 'n_MAX'
   16 | ll T[n_MAX];
      |      ^~~~~
a.cc:16:11: error: expected unqualified-id before ']' token
   16 | ll T[n_MAX];
      |           ^
a.cc: In function 'int check(ll)':
a.cc:23:14: error: 'T' was not declared in this scope
   23 |     while (s+T[i]<=P) {
      |              ^
a.cc: In function 'int solve()':
a.cc:34:20: error: invalid type argument of unary '*' (have 'int')
   34 |   ll right = n_MAX * w_MAX;
      |                    ^
a.cc: In function 'int main(int, const char**)':
a.cc:51:46: error: 'T' was not declared in this scope
   51 |   for (size_t i = 0; i < n; i++) std::cin >> T[i];
      |                                              ^
Language: C++

#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;

int n,k;
vector<int> A;

bool f(ll p){
	ll temp=p;
	int x=0;
	for(int i =0;i<k;i++){
		while(temp>=A[x]){
			temp-=A[x];
			x++;
		}
		temp=p;
	}
	if(x>=n) return true;
	else return false;
}

ll binary_find(ll left,ll right){
	ll mid;
	while(left+1<right){
		mid=(left+right)/2;
		if(f(mid)) right=mid;
		else left=mid;
	}
	return right;
}

int main(){
	int w;
	ll p,sum;
	cin>>n>>k;
	for(int i = 0;i<n;i++){
		cin>>w;
		sum+=w;
		A.push_back(w);
	}
	p=m;
	p=binary_find(0,sum);
	cout<<p<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:11: error: 'm' was not declared in this scope
   44 |         p=m;
      |           ^
Language: C++

#include<iostream>

using namespace std;

typedef long long ll;

ll N, K;
ll W[100000];
 
int check(ll P) {
  int i = 0;
  for (int j = 0; j < K; j++) {
    ll s = 0;
    while(s + W[i] <= P) {
      s += W[i];
      i++;
      if (i == N) {
        return N;
      }
    }
  }
  return i;
}

int solve() {
  ll left = 0;
  ll right = 100000 * 100000;
  ll mid;
  while (right - left > 1) {
    mid = (right + left) / 2;
    int v = check(mid)
    if (v >= n) {
      right = mid;
    } else {
      left = mid;
    }
  }

  return right;
}

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

  cin >> N >> K;
  for(ll i = 0; i < N; i++) {
    cin >> W[i];
  }

  ll ans = solve();
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int solve()':
a.cc:27:21: warning: integer overflow in expression of type 'int' results in '1410065408' [-Woverflow]
   27 |   ll right = 100000 * 100000;
      |              ~~~~~~~^~~~~~~~
a.cc:32:5: error: expected ',' or ';' before 'if'
   32 |     if (v >= n) {
      |     ^~
a.cc:34:7: error: 'else' without a previous 'if'
   34 |     } else {
      |       ^~~~
Language: C++

#include<iostream>

using namespace std;

typedef long long ll;

ll N, K;
ll W[100000];
 
int check(ll P) {
  int i = 0;
  for (int j = 0; j < K; j++) {
    ll s = 0;
    while(s + W[i] <= P) {
      s += W[i];
      i++;
      if (i == N) {
        return N;
      }
    }
  }
  return i;
}

int solve() {
  ll left = 0;
  ll right = 100000 * 100000;
  ll mid;
  while (right - left > 1) {
    mid = (right + left) / 2;
    int v = check(mid);
    if (v >= n) {
      right = mid;
    } else {
      left = mid;
    }
  }

  return right;
}

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

  cin >> N >> K;
  for(ll i = 0; i < N; i++) {
    cin >> W[i];
  }

  ll ans = solve();
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int solve()':
a.cc:27:21: warning: integer overflow in expression of type 'int' results in '1410065408' [-Woverflow]
   27 |   ll right = 100000 * 100000;
      |              ~~~~~~~^~~~~~~~
a.cc:32:14: error: 'n' was not declared in this scope
   32 |     if (v >= n) {
      |              ^
Language: C++

def ok(m):
    c = 1
    tmp = m
    for w in W:
        if tmp > w:
            tmp -= w
        else:
            c += 1
            tmp = m - w
    return k >= c

n, k = map(int, input().split())
W = [int(input()) for i in range(n)]

left = max(W)
right = sum(W)+1
while left+1 < right:
    mid = (left+right) // 2
    if ok(mid):
        right = mid
    else:
        left = mid
print(left)


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def ok(m):
      | ^~~
Language: C++

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

int main() {
    // n : 荷物の個数
    // k : トラックの台数
    int n, k;
    scanf("%d %d", &n, &k);
    
    // w[i] : i番目の荷物の重さ
    int w[n];
    for (int i=0; i<n; i++) scanf("%d", &w[i]);
    
    // t[i] : i番目のトラックの積載量
    int t[k] = {];
    
    // 荷物を降順に並べる
    sort(w, w+n, greater<int>());
    for (int i=0; i<n; i++) {
        int min=1000000, minj;
        // 積載量の小さいトラックを調べる
        for (int j=0; j<k; j++) {
            if(t[j] < min) {
                min = t[j];
                minj = j;
            }
        }
        // 積載量の小さいトラックに積む
        t[minj] += w[i];
    }
    
    // 最大積載量のトラックを探す
    int max=-1;
    for (int j=0; j<k; j++) {
        if(t[j] > max) {
            max = t[j];
        }
    }
    printf("%d\n", max);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: expected primary-expression before ']' token
   17 |     int t[k] = {];
      |                 ^
a.cc:17:17: error: expected '}' before ']' token
   17 |     int t[k] = {];
      |                ~^
Language: C++

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

int n, k;
ll T[MAX];

int solve() {
    ll left=0;
    ll right=100000*10000;
    ll mid;
    while (right-left>1) {
        mid = (left+right)/2;
        int v = check(mid);
        if (v>=n) {
            right=mid;
        }
        else left = mid;
    }
}
int main() {
    cin>>n>>k;
    for (int i=0; i<n; i++) {
        cin>>T[i];
    }
    ll ans = solve();
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int solve()':
a.cc:15:17: error: 'check' was not declared in this scope
   15 |         int v = check(mid);
      |                 ^~~~~
a.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^
Language: Java

import java.util.Scanner;
public static boolean search(int a[], int start, int m, int q)
{
    if(m == 0)
        return true;
    else if(start >= q)
        return false;
    else
        return (search(a,start+1,m,q)||search(a,start+1,m-a[start],q));
}
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n];
        for(int i = 0 ; i < n ; i++)
            num[i] = sc.nextInt();
        int q = sc.nextInt();
        int m[] = new int[q];
        for(int i = 0 ; i < q ; i++)
            m[i] = sc.nextInt();
        for(int i = 0 ; i < q ; i++)
        {
            if(search(a,0,m[i],q))
                System.out.println("yes");
            else
                System.out.println("no");
        }
    }
}


Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static boolean search(int a[], int start, int m, int q)
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.Scanner;
public static boolean search(int a[], int start, int m, int q)
{
    if(m == 0)
        return 1;
    else if(start >= q)
        return 0;
    else
        return (search(a,start+1,m,q)||search(a,start+1,m-a[start],q));
}
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n];
        for(int i = 0 ; i < n ; i++)
            num[i] = sc.nextInt();
        int q = sc.nextInt();
        int m[] = new int[q];
        for(int i = 0 ; i < q ; i++)
            m[i] = sc.nextInt();
        for(int i = 0 ; i < q ; i++)
        {
            if(search(a,0,m[i],q) == 1)
                System.out.println("yes");
            else
                System.out.println("no");
        }
    }
}


Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static boolean search(int a[], int start, int m, int q)
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.Scanner;
public static int search(int a[], int start, int m, int q)
{
    if(m == 0)
        return 1;
    else if(start >= q)
        return 0;
    else
        return (search(a,start+1,m,q)||search(a,start+1,m-a[start],q));
}
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n];
        for(int i = 0 ; i < n ; i++)
            num[i] = sc.nextInt();
        int q = sc.nextInt();
        int m[] = new int[q];
        for(int i = 0 ; i < q ; i++)
            m[i] = sc.nextInt();
        for(int i = 0 ; i < q ; i++)
        {
            if(search(a,0,m[i],q) == 1)
                System.out.println("yes");
            else
                System.out.println("no");
        }
    }
}


Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static int search(int a[], int start, int m, int q)
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.io.*;
import java.util.StringTokenizer;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in);
String line="";
while((line=br.readLine())=br.readLine&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[][] dp=new int[n+1][40001];
int[] a=new int[n];
StringTokenizer st1=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++){
a[i]=Integer.parseInt(st1.nextToken());
}
int n=Integer.parseInt(br.readLine());
int[] b=new int[m];
StringTokenizer st2=new StringTokenizer(br.readLine());
int max=Integer.MIN_VALUE;
for(int i=0;i<m;i++){
b[i]=Integer.parseInt(st2.nextToken());
max=Math.max(max,b[i]);
}
dp[n][0]=1;
for(int i=n-1;i>=0;i--){
for(int j=0;j<=max;j++){
if(j<a[i]) dp[i][j]=dp[i+1][j];
else dp[i][j]=Math.max(dp[i+1][j],dp[i+1][j-a[i]]);
}
}
for(int i=0;i<m;i++){
out.println(dp[0][b[i]]==1?"yes":"no");
}
out.flush();
}
}
}

Compiler output:
Main.java:9: error: ')' or ',' expected
BufferedReader br=new BufferedReader(new InputStreamReader(System.in);
                                                                     ^
1 error
Language: Java

import java.io.*;
import java.util.StringTokenizer;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())=br.readLine&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[][] dp=new int[n+1][40001];
int[] a=new int[n];
StringTokenizer st1=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++){
a[i]=Integer.parseInt(st1.nextToken());
}
int n=Integer.parseInt(br.readLine());
int[] b=new int[m];
StringTokenizer st2=new StringTokenizer(br.readLine());
int max=Integer.MIN_VALUE;
for(int i=0;i<m;i++){
b[i]=Integer.parseInt(st2.nextToken());
max=Math.max(max,b[i]);
}
dp[n][0]=1;
for(int i=n-1;i>=0;i--){
for(int j=0;j<=max;j++){
if(j<a[i]) dp[i][j]=dp[i+1][j];
else dp[i][j]=Math.max(dp[i+1][j],dp[i+1][j-a[i]]);
}
}
for(int i=0;i<m;i++){
out.println(dp[0][b[i]]==1?"yes":"no");
}
out.flush();
}
}
}

Compiler output:
Main.java:11: error: unexpected type
while((line=br.readLine())=br.readLine&&!line.isEmpty()){
           ^
  required: variable
  found:    value
Main.java:11: error: cannot find symbol
while((line=br.readLine())=br.readLine&&!line.isEmpty()){
                             ^
  symbol:   variable readLine
  location: variable br of type BufferedReader
Main.java:19: error: variable n is already defined in method main(String[])
int n=Integer.parseInt(br.readLine());
    ^
Main.java:20: error: cannot find symbol
int[] b=new int[m];
                ^
  symbol:   variable m
  location: class Main
Main.java:23: error: cannot find symbol
for(int i=0;i<m;i++){
              ^
  symbol:   variable m
  location: class Main
Main.java:34: error: cannot find symbol
for(int i=0;i<m;i++){
              ^
  symbol:   variable m
  location: class Main
6 errors
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		new Maub().run();
	}
	
	int n,q,solvePoint;
	int[] A,m;
	boolean[] isSolve;
	
	public void run(){
		
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		A = new int[n];
		
		for (int i = 0; i < n; i++) {
			A[i]= sc.nextInt();
		}
		q = sc.nextInt();
		m = new int[q];
		
		for (int i = 0; i < m.length; i++) {
			m[i]= sc.nextInt();
		}
		isSolve = new boolean[n];
		Arrays.fill(isSolve,false);
		
		solvePoint = 0;
		
		for (int i = 0; i < m.length; i++) {
			solve(0, m[i]);
			solvePoint++;
			if(isSolve[i]){
				System.out.println("yes");
			}
			else{
				System.out.println("no");
			}
		}
		
	}
	public void solve(int i,int mi){
		
		if(i==n){
			if (mi==0) {
				isSolve[solvePoint]= true;
			}
			return;
		}
		
		solve(i+1,mi);
		solve(i+1,mi-A[i]);
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		new Maub().run();
		    ^
  symbol:   class Maub
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Maib {
	static int n;
	static int[] A;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Main eSearch = new Main();
		n = in.nextInt();
		A = new int[n];
		for(int i = 0;i<n;i++){
			A[i] = in.nextInt();
		}
		int q = in.nextInt();
		int[] m = new int[q];
		for(int j=0;j<q;j++){
			m[j] = in.nextInt();
			if(eSearch.solve(0, m[j]))
				System.out.println("yes");
			else 
				System.out.println("no");
		}
	}
	public boolean solve(int i,int m){
		if(m==0) return true;
		if(i>=n) return false;
		
		boolean res = solve(i+1,m)||solve(i+1,m-A[i]);
		return res;
	}
}

Compiler output:
Main.java:3: error: class Maib is public, should be declared in a file named Maib.java
public class Maib {
       ^
Main.java:8: error: cannot access Main
		Main eSearch = new Main();
		^
  bad source file: ./Main.java
    file does not contain class Main
    Please remove or make sure it appears in the correct subdirectory of the sourcepath.
2 errors
Language: Java

public class Main {
	static int n;
	static int[] A;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Main eSearch = new Main();
		n = in.nextInt();
		A = new int[n];
		for(int i = 0;i<n;i++){
			A[i] = in.nextInt();
		}
		int q = in.nextInt();
		int[] m = new int[q];
		for(int j=0;j<q;j++){
			m[j] = in.nextInt();
			if(eSearch.solve(0, m[j]))
				System.out.println("yes");
			else 
				System.out.println("no");
		}
	}
	public boolean solve(int i,int m){
		if(m==0) return true;
		if(i>=n) return false;
		
		boolean res = solve(i+1,m)||solve(i+1,m-A[i]);
		return res;
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

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

	//Scanner??????????????????????????????scan?????????
	Scanner scan = new Scanner(System.in);

	//??????A?????\???????´?????????°n???????????????
	int n = scan.nextInt();
	
	//??????A???????????????
	int[] A = new int[n];
	for(int i = 0; i < n; i++){
	    A[i] = scan.nextInt();
	}

	//??????M?????\???????´?????????°q???????????????
	int q = scan.nextInt();

	//??????M???????????????
	int[] M = new int[q];
	for(int i = 0; i < q; i++){
	    M[i] = scan.nextInt();
	}

	for(int i = 0; i < q; i++){
	    if(solve(0,M[i], n, A)) System.out.println("yes");
	    else System.out.println("no");
	}
			       

    }

    public static boolean solve(int i, int m, int n, int[] A){
	
	if(m == 0) return true;
	if(i >= n) return false;

	boolean ans = solve(i + 1, m, n, A) || solve(i + 1, m - A[i], n, A);
	return ans;
    }
}

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

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Recursion {
	static List<Integer> aList = new ArrayList<>();

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			aList.add(sc.nextInt());
		}
		int q = sc.nextInt();
		List<Integer> mList = new ArrayList<>();
		for (int i = 0; i < q; i++) {
			mList.add(sc.nextInt());
		}
		
		for (Integer m : mList) {
			if (isMatch(0, 0, m.intValue())) {
				System.out.println("yes");
			} else {
				System.out.println("no");
			}
		}
		
	}
	
	public static boolean isMatch(int j, int S, int T) {
			if (S == T) {
				return true;
			}
			for (int i = j; i < aList.size(); i++) {
				if (isMatch(i + 1, S + aList.get(i).intValue(), T)) {
					return true;
				}
			}
			return false;
		}
}

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

import java.util.Scanner;

public class Main{
    static int num;
    static int[] array;
    
    private static boolean check(int i, int m){
        if(m == 0) return true;
        if(i >= n) return false;
        return check(i + 1, m) || check(i + i, m - array[i]);
    }
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        num = sc.nextInt();
        array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        int q = sc.nextInt;
        int m = 0;
        for(int i = 0; i < q; i++){
            m = sc.nextInt();
            if(check(0, m)){
                System.out.println("yes");
            }else{
                System.out.println("no");
            }
        }
        
    }
}


Compiler output:
Main.java:9: error: cannot find symbol
        if(i >= n) return false;
                ^
  symbol:   variable n
  location: class Main
Main.java:20: error: cannot find symbol
        int q = sc.nextInt;
                  ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
2 errors
Language: Java

import java.util.Scanner;

public class Main{
    static int num;
    static int[] array;
    
    private static boolean check(int i, int m){
        if(m == 0) return true;
        if(i >= n) return false;
        return check(i + 1, m) || check(i + i, m - array[i]);
    }
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        num = sc.nextInt();
        array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        int q = sc.nextInt();
        int m = 0;
        for(int i = 0; i < q; i++){
            m = sc.nextInt();
            if(check(0, m)){
                System.out.println("yes");
            }else{
                System.out.println("no");
            }
        }
        
    }
}


Compiler output:
Main.java:9: error: cannot find symbol
        if(i >= n) return false;
                ^
  symbol:   variable n
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class ALDS1_5_A {
	private static int n, m;
	private static int[] a, b;
	
	public static void main(String[] args) {
		inputData();
		solve();
	}
	
	private static void inputData() {
		try (Scanner scan = new Scanner(System.in)) {
			n = scan.nextInt();
			a = new int[n];
			for(int i=0; i<n; i++) a[i] = scan.nextInt();
			m = scan.nextInt();
			b = new int[m];
			for(int i=0; i<m; i++) b[i] = scan.nextInt();
		}
	}
	
	private static void solve() {
		for(int i=0; i<m; i++) {
			if(serchNumber(0, b[i])) {
				System.out.println("yes");
			} else {
				System.out.println("no");
			}
		}
	}
	
	private static boolean serchNumber(int i, int m) {
		if(i == n) return false;
		if(m < 0) return false;
		if(m == 0) return true;
		if(serchNumber(i+1, m)) return true;
		if(serchNumber(i+1, m-a[i])) return true;
		return false;
	}
}



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

//16D8101015D
import java.util.*;
public class Exhaustive_search{
    public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
	int n=sc.nextInt();    //数列Aの個数
	int[] A=new int[n];
	for(int i=0;i<n;i++){
	    A[i]=sc.nextInt();    //この数列の値を組み合わせて,
	}
	int q=sc.nextInt();
	int[] m=new int[q];
	for(int i=0;i<q;i++){
	    m[i]=sc.nextInt();    //この数字にする
	}
	int[] flag=new int[q];
	//2個
	for(int c=0;c<m.length;c++){
	    flag[c]=0;
	    for(int i=0;i<A.length-1;i++){
		for(int j=i+1;j<A.length;j++){
		    if(A[i]+A[j]==m[c]){
			flag[c]=1;
			break;
		    }
		}
	    }
	}

	//3個
	for(int c=0;c<m.length;c++){
	    if(flag[c]==0){
		flag[c]=0;
		for(int i=0;i<A.length-2;i++){
		    for(int j=i+1;j<A.length-1;j++){
			for(int k=j+1;k<A.length;k++){
			    if(A[i]+A[j]==m[c]){
				flag[c]=1;
				break;
			    }
			}
		    }
		}
	    }
	    if(flag[c]==0){
		System.out.println("no");
	    }else{
		System.out.println("yes");
	    }
	}
    }
}


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

def solve(i,m):
	if(m==0):return 1
	if(i>=n):return 0
	res = solve(i+1,m) or solve(i+1, m-int(list[i]))
	return res

n=0
list=[]
q=0
M=0

n=int(input())

i=0
while i<n:
	list.append(input())
	i=i+1

q=int(input())

i=0
while i<q:
	M=int(input())
	if(solve(0,M)): print("yes")
	else: print("no")
	i=i+1

return 0


Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
def solve(i,m):
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
def solve(i,m):
           ^
Main.java:1: error: <identifier> expected
def solve(i,m):
             ^
Main.java:1: error: ';' expected
def solve(i,m):
              ^
Main.java:4: error: class, interface, enum, or record expected
	res = solve(i+1,m) or solve(i+1, m-int(list[i]))
	                                   ^
5 errors
Language: Java

def solve(i,m):
	if(m==0):return 1
	if(i>=n):return 0
	res=solve(i+1,m) or solve(i+1, m-int(list[i]))
	return res

n=0
list=[]
q=0
M=0

n=int(input())

i=0
while i<n:
	list.append(input())
	i=i+1

q=int(input())

i=0
while i<q:
	M=int(input())
	if(solve(0,M)): print("yes");
	else: print("no");
	i=i+1


Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
def solve(i,m):
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
def solve(i,m):
           ^
Main.java:1: error: <identifier> expected
def solve(i,m):
             ^
Main.java:1: error: ';' expected
def solve(i,m):
              ^
Main.java:4: error: class, interface, enum, or record expected
	res=solve(i+1,m) or solve(i+1, m-int(list[i]))
	                                 ^
Main.java:25: error: class, interface, enum, or record expected
	else: print("no");
	^
Main.java:26: error: class, interface, enum, or record expected
	i=i+1
	^
7 errors
Language: Java


import java.util.ArrayDeque;
import java.util.BitSet;
import java.util.Deque;

public class Main {
    public static void main(String[] args) {
        Deque deque = new ArrayDeque();
        StringBuilder sb = new StringBuilder();
        FS fs = new FS();
        int n = fs.nextInt();
        BitSet bitSet = new BitSet(2000);
        for(int i=0;i<n;i++){
            Integer m = fs.nextInt();
            bitSet.set(m);
            for (Object k:deque){
                bitSet.set((Integer)k+m);
            }
            deque.add(m);
        }
        int q = fs.nextInt();
        for (int i=0;i<q;i++){
           sb.append( bitSet.get(fs.nextInt())?"yes\n":"no\n");
        }
        System.out.print(sb.toString());
    }
static class FS {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        return hasNextByte() ? buffer[ptr++] : -1;
    }

    private boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    private void skipUnprintable() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
    }

    public boolean hasNext() {
        skipUnprintable();
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public int nextInt() {
        return (int) nextLong();
    }

    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
}



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


import java.util.ArrayDeque;
import java.util.BitSet;
import java.util.Deque;

public class Main {
    public static void main(String[] args) {
        Deque deque = new ArrayDeque();
        StringBuilder sb = new StringBuilder();
        Scanner fs = new Scanner(System.in);
        int n = fs.nextInt();
        BitSet bitSet = new BitSet(2000);
        for(int i=0;i<n;i++){
            Integer m = fs.nextInt();
            bitSet.set(m);
            for (Object k:deque){
                bitSet.set((Integer)k+m);
            }
            deque.add(m);
        }
        int q = fs.nextInt();
        for (int i=0;i<q;i++){
           sb.append( bitSet.get(fs.nextInt())?"yes\n":"no\n");
        }
        System.out.print(sb.toString());
    }
 
}




Compiler output:
Main.java:10: error: cannot find symbol
        Scanner fs = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:10: error: cannot find symbol
        Scanner fs = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Language: Java

import java.util.ArrayDeque;
import java.util.BitSet;
import java.util.Deque;
import java.util.Scanner;
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;


public class _AE {
    public static void main(String[] args){
        Deque<Integer> deque = new ArrayDeque<Integer>();
        StringBuilder sb = new StringBuilder();
        FS fs = new FS();
        int n = fs.nextInt();
        BitSet bitSet = mnew BitSet(2000);
        for(int i=0;i<n;i++){
            Integer m = fs.nextInt();
            bitSet.set(m);
            Object[] mm = deque.toArray();
            for (int j=0;j<mm.length;j++){
                int i1 = ((Integer) mm[j]) + m;
                bitSet.set(i1);
                deque.add(i1);
            }
            deque.add(m);
        }
        int q = fs.nextInt();
        for (int i=0;i<q;i++){
           sb.append( bitSet.get(fs.nextInt())?"yes\n":"no\n");
        }
        System.out.print(sb.toString());
    }



public class FS {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        return hasNextByte() ? buffer[ptr++] : -1;
    }

    private boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    private void skipUnprintable() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
    }

    public boolean hasNext() {
        skipUnprintable();
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public int nextInt() {
        return (int) nextLong();
    }

    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
}
}


Compiler output:
Main.java:16: error: ';' expected
        BitSet bitSet = mnew BitSet(2000);
                            ^
1 error