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

/*
* be kind, work hard
*/
/******************************************************************************/
/**///#include <boost/multiprecision/cpp_int.hpp>
/**/#include <bits/stdc++.h>                                                
/**/
/**/#define endl            "\n"
/**/#define pb              push_back
/**/#define X               first
/**/#define Y               second
/**/#define setZero(array)  memset((array), 0, sizeof (array))
/**/#define setOne(array)   memset((array), 1, sizeof (array))
/**/#define setTrue(array)  memset((array), true, sizeof (array))
/**/#define setFalse(array) memset((array), false, sizeof (array))
/**/#define HAYAKU          ios_base::sync_with_stdio(false);cin.tie(NULL);
/**/#define int             long long
/**/#define LIVE            return
/**/#define FREE            1
/**/#define OR              and
/**/#define DIE             0
/******************************************************************************/
/*
using boost::multiprecision::cpp_int;
*/

typedef long long ll;

using namespace std;

const int MOD = 1e9 + 7;
const int N   = 1e5;

void preprocess(){
    return;
}

int inline solve(){
    int n, m, k, i, j, cnt = 0;
    
    cin >> n >> m >> k;
    
    int a[n], b[m];
    
    for(i=0; i<n; ++i)
        cin >> a[i];
    
    for(i=0; i<m; ++i)
        cin >> b[i];
    
    i = j = 0;
    while(i < n and j < m and k > 0){
        if(a[i] < b[j] and a[i] <= k){
            k -= a[i++]; ++cnt;
        } else if(b[j] <= k){
            k -= b[j++]; ++cnt;
        } else {++i; ++j};
    }
    cout << cnt;
    return 0;
}

signed main(){
    HAYAKU
    
    preprocess();
    
    int t = 1;
    
//    cin >> t;
    
    for(int i=1; i<=t; ++i){
//        cout << "Case #" << i << ": ";
//        cout << 
            solve();
//        cout << endl;
    }
    
    LIVE FREE OR DIE;
}

Compiler output:
a.cc: In function 'long long int solve()':
a.cc:57:25: error: expected ';' before '}' token
   57 |         } else {++i; ++j};
      |                         ^
      |                         ;
Language: C++

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

int main(){
    int n, m;
    long long k;
    cin >> n >> m >> k;

    long long a[n];
    long long b[m];

    for(int i = 0; i < n; i++)
        cout << a[i] << endl;

    for(int i = 0; i < m; i++)
        cout << b[i] << endl;

    int ans = 0;
    while(true){
        int i = 0;
        int j = 0;
        if(k - min(a[i], b[j]) < 0)
            break;

        if(a[i] < b[j] || j = m){
            k -= a[i];
            i++;
            ans++;
        }
        if(a[i] > b[j] || i == n){
            k-=b[j];
            j++;
            ans++;
        }
    }
    /*while(true){
        long long i = 0;
        long long j = 0;
        long long sum = 0;

        if(sum + a[i] > k || sum + b[j] > k)
            break;

        if(a[i] < b[j]){
            sum += a[i];
            i++;
            ans++;
        }else if(a[i] > b[j]){
            sum += b[j];
            j++;
            ans++;
        }else{
            if(a[i + 1] < b[j + 1]){
                sum += a[i];
                i++;
                ans++;
            }
            if(a[i + 1] > b[i + 1]){
                sum += b[i];
                j++;
                ans++;
            }
        }
    }*/

    cout << ans << endl;


    

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:24: error: lvalue required as left operand of assignment
   25 |         if(a[i] < b[j] || j = m){
      |            ~~~~~~~~~~~~^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int N,M,K;
    std::cin >> N >> M >> K;
    int A[N];
    for(int i = 0;i < N;i++ ){
        std::cin >> A[i];
    }
    int B[M];
    for(int i = 0;i < M;i++ ){
        std::cin >> B[i];
    }
    int Count = 0;
    int Acount = 0;
    int Bcount = 0;
    while(Count < K){
        if(Acount + 1 <= N){
            if(Bcount + 1 <= M && B[Bcount] < A[Acount]){
                Bcount++;
                Count++;
            }else{
                Acount++;
                Count++;
            }
        }else if(BCount + 1 <= M){
            if(Acount + 1 <= N && A[Acount] < B[Bcount]){
                Acount++;
                Count++;
            }else{
                Bcount++;
                Count++;
            }
        }else{
            break;
        }
    }
    std::cout << Count << std::endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:18: error: 'BCount' was not declared in this scope; did you mean 'Bcount'?
   26 |         }else if(BCount + 1 <= M){
      |                  ^~~~~~
      |                  Bcount
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  queue<long long> A;
  queue<long long> B;
  for(long long i = 0; i < n; i++){
    long long a = 0;
    cin >> a;
    A.push(a);
  }
  for(long long i = 0; i < m; i++){
    long long b= 0;
    cin >> b;
    B.push(b);
  }
  
  long long S = 0;
  long long count = 0;
  while(S < k){
    if((A.empty()) && !(B.empty())){
      S += B.front();
      B.pop();
      count++;
    }
    else if(!(A.empty()) && (B.empty())){
      S += A.front();
      A.pop();
      count++;
    }
    else if(A.empty() && B.empty()){
      break;
    }
    else if(!(A.empty() && B.empty()){
      if(A.front() > B.front()){
        S += B.front();
        B.pop();
        count++;
      }
      else if(A.front() < B.front()){
        S += A.front();
        A.pop();
        count++;
      }
      else if(A.front() == B.front()){
        S += A.front();
        A.pop();
        count++;
      }
    }
    if(S > k){
      count--;
    }
  }
  cout << count;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:38: error: expected ')' before '{' token
   36 |     else if(!(A.empty() && B.empty()){
      |            ~                         ^
      |                                      )
a.cc:56:3: error: expected primary-expression before '}' token
   56 |   }
      |   ^
Language: C

#include <bits/stdc++.h>
#define N 200005
using namespace std;
long long s, n, m, i, j, k, a[N], b[N], ans;
int main(){
	scanf("%lld %lld %lld\n", &n, &m, &s);
	for(i=1; i<=n; i++){
		scanf("%lld", &a[i]);
	}
	for(j=1; j<=m; j++){
		scanf("%lld", &b[j]);
	}
	i=1, j=1;
	while(s>0){
		if(i>n && j>m) break;
		if(i>n){
			s-=b[j++];
			ans++;
		}
		else if(j>m){
			s-=a[i++];
			ans++;
		}
		else{
			if(a[i]<=b[j]){
				s-=a[i++];
				ans++;
			}
			else{
				s-=b[j++];
				ans++;
			}
		}
	}
	if(s<0) ans--;
	printf("%lld", ans);
	return 0;
}

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



import java.util.Scanner;

public class C1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        long k = sc.nextLong();
        long[] A = new long[N+1];
        long[] B = new long[M+1];

        for(int i = 0; i < N; i++) {
            A[i] = sc.nextLong();
        }
        for(int i = 0; i < M; i++) {
            B[i] = sc.nextLong();
        }
        A[N] = Integer.MAX_VALUE;
        B[M] = Integer.MAX_VALUE;

        int a = 0;
        int b = 0;
        int res = 0;
        long total = 0;
        while(true) {
            if(A[a] > B[b]) {
                total += B[b];
                b++;
            } else {
                total += A[a];
                a++;
            }
            if(a+b>(M+N)) break;
            if(total > k) break;
            res++;
        }
        System.out.println(res);
    }
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  queue<long long> A;
  queue<long long> B;
  for(long long i = 0; i < n; i++){
    long long a = 0;
    cin >> a;
    A.push(a);
  }
  for(long long i = 0; i < m; i++){
    long long b= 0;
    cin >> b;
    B.push(b);
  }
  
  long long S = 0;
  long long count = 0;
  while(S < k){
    if((A.empty()) && !(B.empty())){
      S += B.front();
      B.pop();
      count++;
    }
    else if(!(A.empty()) && (B.empty())){
      S += A.front();
      A.pop();
      count++;
    }
    else if(A.empty() && B.empty()){
      break;
    }
    else if(!(A.empty() && B.empty())
      if(A.front() > B.front()){
        S += B.front();
        B.pop();
        count++;
      }
      else if(A.front() < B.front()){
        S += A.front();
        A.pop();
        count++;
      }
      else if(A.front() == B.front()){
        S += A.front();
        A.pop();
        count++;
      }
    }
    if(S > k){
      count--;
    }
  }
  cout << count;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:38: error: expected ')' before 'if'
   36 |     else if(!(A.empty() && B.empty())
      |            ~                         ^
      |                                      )
   37 |       if(A.front() > B.front()){
      |       ~~                              
a.cc:52:5: error: expected primary-expression before '}' token
   52 |     }
      |     ^
a.cc: At global scope:
a.cc:57:3: error: 'cout' does not name a type
   57 |   cout << count;
      |   ^~~~
a.cc:58:1: error: expected declaration before '}' token
   58 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int N,M,K;
    std::cin >> N >> M >> K;
    int A[N];
    for(int i = 0;i < N;i++ ){
        std::cin >> A[i];
    }
    int B[M];
    for(int i = 0;i < M;i++ ){
        std::cin >> B[i];
    }
    int Count = 0;
    int Acoount = 0;
    int Bcount = 0;
    while(Count < K){
        if(Acount + 1 <= N){
            if(Bcount + 1 <= M && B[Bcount] < A[Acount]){
                Bcount++;
                Count++;
            }else{
                Acount++;
                Count++;
            }
        }else if(BCount + 1 <= M){
            if(Acount + 1 <= N && A[Acount] < B[Bcount]){
                Acount++;
                Count++;
            }else{
                Bcount++;
                Count++;
            }
        }else{
            break;
        }
    }
    std::cout << Count << std::endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: 'Acount' was not declared in this scope; did you mean 'Bcount'?
   18 |         if(Acount + 1 <= N){
      |            ^~~~~~
      |            Bcount
a.cc:26:18: error: 'BCount' was not declared in this scope; did you mean 'Bcount'?
   26 |         }else if(BCount + 1 <= M){
      |                  ^~~~~~
      |                  Bcount
Language: C++

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

int main(){
  
  int a,b,c,sum=0;
  cin >> a >> b >> c;
  vector<int> x(a);
  for(int i=0;i<a;i++){
    cin >> x.at(i);
  }
   vector<int> z(b);
  for(int j=0;j<b;j++){
    cin >> z.at(j);
  }
  
  for(int i=0;i<a;i++){
    for(int j=0;j<b;j++){
      c = c - x.at(i);
      c = c - z.at(j);
      
    if( c >= 0 ){
        sum++;
      }
    
    else if( c < o ){
        break;
      }
      
      cout << sum << endl;
     }
    }
  
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:26:18: error: 'o' was not declared in this scope
   26 |     else if( c < o ){
      |                  ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    int N,M,K;
    std::cin >> N >> M >> K;
    int A[N}];
    for(int i = 0;i < N;i++ ){
        std::cin >> A[i];
    }
    int B[M];
    for(int i = 0;i < M;i++ ){
        std::cin >> B[i];
    }
    int Count = 0;
    int Acoount = 0;
    int Bcount = 0;
    while(Count < K){
        if(Acount + 1 <= N){
            if(Bcount + 1 <= M && B[Bcount] < A[Acount]){
                Bcount++;
                Count++;
            }else{
                Acount++;
                Count++;
            }
        }else if(BCount + 1 <= M){
            if(Acount + 1 <= N && A[Acount] < B[Bcount]){
                Acount++;
                Count++;
            }else{
                Bcount++;
                Count++;
            }
        }else{
            break;
        }
    }
    std::cout << Count << std::endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected ']' before '}' token
    7 |     int A[N}];
      |            ^
      |            ]
a.cc: At global scope:
a.cc:7:13: error: expected unqualified-id before ']' token
    7 |     int A[N}];
      |             ^
a.cc:8:5: error: expected unqualified-id before 'for'
    8 |     for(int i = 0;i < N;i++ ){
      |     ^~~
a.cc:8:19: error: 'i' does not name a type
    8 |     for(int i = 0;i < N;i++ ){
      |                   ^
a.cc:8:25: error: 'i' does not name a type
    8 |     for(int i = 0;i < N;i++ ){
      |                         ^
a.cc:11:11: error: 'M' was not declared in this scope
   11 |     int B[M];
      |           ^
a.cc:12:5: error: expected unqualified-id before 'for'
   12 |     for(int i = 0;i < M;i++ ){
      |     ^~~
a.cc:12:19: error: 'i' does not name a type
   12 |     for(int i = 0;i < M;i++ ){
      |                   ^
a.cc:12:25: error: 'i' does not name a type
   12 |     for(int i = 0;i < M;i++ ){
      |                         ^
a.cc:18:5: error: expected unqualified-id before 'while'
   18 |     while(Count < K){
      |     ^~~~~
a.cc:39:10: error: 'cout' in namespace 'std' does not name a type
   39 |     std::cout << Count << std::endl;
      |          ^~~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef long long ll;
typedef long double ld;

int  main()
{
	cpp_int n,m,k; cin >> n >> m >> k;
	vector <cpp_int> a(n);
	vector <cpp_int> b(m);
	queue <cpp_int> aq;
	queue <cpp_int> bq;
	rep(i, n)
	{
		cin >> a[i];
		aq.push(a[i]);
	}
	rep(i, m)
	{
		cin >> b[i];
		bq.push(b[i]);
	}
	cpp_int cnt = 0;
	while (1)
	{
		if ((!aq.empty() && !bq.empty()) &&(k >= aq.front() && k >= bq.front()))
		{
			if (aq.front() <= bq.front())
			{
				k-= aq.front();
				aq.pop();
				cnt++;
			}
			else
			{
				k-= bq.front();
				bq.pop();
				cnt++;
			}
		}
		else if ((!aq.empty() && !bq.empty()))
		{
			if (k >= aq.front())
			{
				k-= aq.front();
				aq.pop();
				cnt++;
			}
			else if (k >= bq.front())
			{
				k-= bq.front();
				bq.pop();
				cnt++;
			}
		}
		else if (!aq.empty() && k >= aq.front())
		{
			k-= aq.front();
			aq.pop();
			cnt++;
		}
		else if (!bq.empty() && k >= bq.front())
		{
			k-= bq.front();
			bq.pop();
			cnt++;
		}
		if (!aq.empty() && !bq.empty() && aq.front() > k && bq.front() > k)
			break;
		else if (!aq.empty() && aq.front() > k && bq.empty())
			break;
		else if (!bq.empty()  && bq.front() > k && aq.empty())
			break;
		else if (aq.empty() && bq.empty())
			break;
	}
	cout << cnt << endl;
	return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  queue<long long> A;
  queue<long long> B;
  for(long long i = 0; i < n; i++){a
    long long a = 0;
    cin >> a;
    A.push(a);
  }
  for(long long i = 0; i < m; i++){
    long long b= 0;
    cin >> b;
    B.push(b);
  }
  
  long long S = 0;
  long long count = 0;
  while(S < k){
    if((A.empty()) && !(B.empty())){
      S += B.front();
      B.pop();
      count++;
    }
    else if(!(A.empty()) && (B.empty())){
      S += A.front();
      A.pop();
      count++;
    }
    else if(A.empty() && B.empty()){
      break;
    }
    else{
      if(A.front() > B.front()){
        S += B.front();
        B.pop();
        count++;
      }
      else if(A.front() < B.front()){
        S += A.front();
        A.pop();
        count++;
      }
      else if(A.front() == B.front()){
        S += A.front();
        A.pop();
        count++;
      }
    }
    if(S > k){
      count--;
    }
  }
  cout << count;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:36: error: 'a' was not declared in this scope
    9 |   for(long long i = 0; i < n; i++){a
      |                                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  vector<int> honna(a), honnb(b);
    for (int i = 0; i < a; i++) {
      cin >> honna.at(i);
    }
  for (int j = 0; j < b; j++) {
    cin >> honnb.at(j);
  }
  int kaunto = 0;
  int anoyatu = 0;
  int bnoyatu = 0;
  
  for (int i = 0; i < 200000; i++) {
    if (anoyatu >= a || bnoyatu >= b) {
      break;
    }
    if (c < 0) {
            kaunto -= 1;
            break;
    }
  if (honna.at(anoyatu) < honnb.at(bnoyatu)) {
    kaunto += 1;
    anoyatu += 1;
  }
    if (c < 0) {
            kaunto -= 1;
            break;
    }
    if (anoyatu >= a || bnoyatu >= b) {
      break;
    }
    if (c < 0) {
            kaunto -= 1;
            break;
    }
      if (honna.at(anoyatu) > honnb.at(bnoyatu)) {
        kaunto += 1;
        bnoyatu += 1;
      }
    if (c < 0) {
            kaunto -= 1;
            break;
      if (honna.at(anoyatu) == honnb.at(bnoyatu) {
        if (honna.at(anoyatu + 1) > honnb.at(bnoyatu + 1) {
          bnoyatu += 1;
          kaunto += 1
        }
            else {
              anoyatu += 1;
              kaunto += 1;
            }
    }
       if (anoyatu >= a || bnoyatu >= b) {
      break;
    }     
    if (anoyatu >= a || bnoyatu >= b) {
      break;
    }
          if (c < 0) {
            kaunto -= 1;
            break;
          }
          }
          cout << kaunto << endl;
          }

Compiler output:
a.cc: In function 'int main()':
a.cc:48:49: error: expected ')' before '{' token
   48 |       if (honna.at(anoyatu) == honnb.at(bnoyatu) {
      |          ~                                      ^~
      |                                                 )
a.cc:68:11: error: expected primary-expression before '}' token
   68 |           }
      |           ^
a.cc:70:12: error: expected '}' at end of input
   70 |           }
      |            ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main(){
    ll n,m,k;
    cin>>n>>m>>k;
    vector<ll> a(n),b(m);
    ll sum1=0;
    ll sum2=0;
    rep(i,n){
        cin>>a[i];
        sum1+=a[i];
    }
    rep(i,m){
        cin>>b[i];
        sum2+=b[i];
    }
    
    ll ans=n+m;
    if(sum1+sum2<=k){
        cout<<ans<<"\n";
        return 0;
    }
    
    ll t=0;
    ll i=0;
    ll j=0;
    bool exit=true;
    while(exit){
        if(i=n-1 && j=m-1){
            break;
        }else if(i<n-1 && j<m-1){
            if(a[i]<b[j]){
                t+=a[i];
                i++;
            }
            else{
                t+=b[j];
                j++;
            }
        }else if(j>m-1){
                t+=a[i];
                i++;
        }else{
            t+=b[j];
            j++;
        }
        if(t>=k) exit=false;
    }
    if(t>k) cout<<i+j-1<<"\n";
    else cout<<i+j<<"\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: lvalue required as left operand of assignment
   32 |         if(i=n-1 && j=m-1){
      |              ~~~~^~~~
Language: C++

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

int main(){
  int n, m;
  ll k;
  cin >> n >> m >> k;
  queue<int> a, b;
  for(int i = 0; i < n; i++){
    int x;
    cin >> x;
    a.push(x);
  }
  for(int i = 0; i < m; i++){
    int y;
    cin >> y;
    b.push(y);
  }
  
  ll time = 0;
  int ans = 0;
  while(true){
    if(a.size() == 0){
      time += (ll)b.front();
      b.pop();
    }else if(b.size() == 0){
      time += (ll)a.front();
      a.pop();
    }else if(a.front() > b.front()){
      time += (ll)b.front();
      b.pop();
    }else if(b.front() >= a.front()){
      time += (ll)a.front();
      a.pop();
    if(time > k) break;
    ans++;
    if(a.size() == 0 && b.size() == 0) break;
  }
  
  cout << ans << endl;
  return 0;
}

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

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

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()

const int mod = 1e9+7;



int main() {
    ll n, m, k;
    cin >> n >> m >> k;
    vector<ll> a(n+1, 0), b(m+1, 0);
    rep (i, n) {
        cin >> a[i+1];
        a[i+1] += a[i];
    }
    rep (i, m) {
        cin >> b[i+1];
        b[i+1] += b[i];
    }
    ll ans = 0;
    rep (i, n+1) {
        ll time_a = a[i];
        ll time_left = k - time_a;
        if (time_left < 0) {
            break;
        }
        auto it = upper_bound(all(b), time_left);
        int b_books = distance(b.begin(), it) - 1;
        chmax(ans, b_books+i);
    }
    cout << ans << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:40:14: error: no matching function for call to 'chmax(ll&, int)'
   40 |         chmax(ans, b_books+i);
      |         ~~~~~^~~~~~~~~~~~~~~~
a.cc:7:24: note: candidate: 'template<class T> bool chmax(T&, const T&)'
    7 | template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
      |                        ^~~~~
a.cc:7:24: note:   template argument deduction/substitution failed:
a.cc:40:14: note:   deduced conflicting types for parameter 'const T' ('long long int' and 'int')
   40 |         chmax(ans, b_books+i);
      |         ~~~~~^~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include<iostream>
#include<string.h>
#include<vector>
#include<algorithm>

using namespace std;

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int a[n], b[m];
  for(int i { 0 }; i < n; ++i){
        cin >> a[i];
    }

    for(int i { 0 }; i < m; ++i){
        cin >> b[i];
    }

  a.insert(a.end(), b.begin(), b.end()); 
   sort(a.begin(),a.end());
  int count =0, out=0;
  for(int l=0;count <= k;l++){
    count += a[l];
    out++;
}
  cout << out <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: request for member 'insert' in 'a', which is of non-class type 'int [n]'
   21 |   a.insert(a.end(), b.begin(), b.end());
      |     ^~~~~~
a.cc:21:14: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   21 |   a.insert(a.end(), b.begin(), b.end());
      |              ^~~
a.cc:21:23: error: request for member 'begin' in 'b', which is of non-class type 'int [m]'
   21 |   a.insert(a.end(), b.begin(), b.end());
      |                       ^~~~~
a.cc:21:34: error: request for member 'end' in 'b', which is of non-class type 'int [m]'
   21 |   a.insert(a.end(), b.begin(), b.end());
      |                                  ^~~
a.cc:22:11: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   22 |    sort(a.begin(),a.end());
      |           ^~~~~
a.cc:22:21: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   22 |    sort(a.begin(),a.end());
      |                     ^~~
Language: C++

// In the name of God

#include <bits/stdc++.h>

using namespace std;

const int N = 2e5+5;

long long a[N], b[N];

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

	int n, m, k;
	cin >> n >> m >> k;

	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(i) a[i] += a[i-1];
	}

	for(int i = 0; i < m; i++) {
		cin >> b[i];
		if(i) b[i] += b[i-1];
	}

	int ans = upper_bound(b, b+m, k) - b;

	for(int i = 0; i < n; i++) {
		if(a[i] > k) break;
		ans = max(ans, upper_bound(b, b+m, k - a[i]) - b + (i + 1));
	}

	cout << ans;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:26: error: no matching function for call to 'max(int&, long int)'
   32 |                 ans = max(ans, upper_bound(b, b+m, k - a[i]) - b + (i + 1));
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:32:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   32 |                 ans = max(ans, upper_bound(b, b+m, k - a[i]) - b + (i + 1));
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:32:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   32 |                 ans = max(ans, upper_bound(b, b+m, k - a[i]) - b + (i + 1));
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

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

int main()
{
   int n,m,k;
   cin>>n>>m>>k;
   int a[n],b[m]; 
   for(int i=0;i<n;i++)
   cin>>a[i];
   
   for(int i=0;i<m;i++)
   cin>>b[i];
   
   
   int t=0;
   int count=0;
   int r=0,s=0;
   for(int x=0;x<n+m;x++){
      if(a[r]>k && b[s]>k)
      break;
      
       if(r<n && a[r]<b[s]){
       t+=a[r];
       
           r++;
           
       }
       elseif(s<m && b[s]<a[r]){
       t+=b[s];
       
           s++;
       }
       
       
      if(t>k)
       break; 
       count++;
      
     }
     
      
   cout<<count;
   
   

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:8: error: 'elseif' was not declared in this scope
   38 |        elseif(s<m && b[s]<a[r]){
      |        ^~~~~~
Language: C++

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

int main()
{
  int n, m, k;
  int a_stock=0, b_stock=0;

  cin >> n >> m >> k;

  vector<int> A(n), B(m);

  for(int i=0; i < n; i++) {
    cin >> A.at(i);
  }
  for(int j=0; j < m; j++) {
    cin >> B.at(j);
  }

  int i=0, j=0;

  while(k > 0) {
    if(A[i] <=  B[j]) {
      if((k - A[i]) < 0) break;
      k -= A[i];
      i++;
    } else {
      if((k - B[j]) < 0) break;
      k -= B[j];
      j++;
    }
  }

  int ans = i + j;

  if(k == 0) ans;

  cout << ans << endl;

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

int main()
{
  int n, m, k;
  int a_stock=0, b_stock=0;

  cin >> n >> m >> k;

  vector<int> A(n), B(m);

  for(int i=0; i < n; i++) {
    cin >> A.at(i);
  }
  for(int j=0; j < m; j++) {
    cin >> B.at(j);
  }

  int i=0, j=0;

  while(k > 0) {
    if(A[i] <=  B[j]) {
      if((k - A[i]) < 0) break;
      k -= A[i];
      i++;
    } else {
      if((k - B[j]) < 0) break;
      k -= B[j];
      j++;
    }
  }

  int ans = i + j;

  if(k == 0) ans;

  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc:41:2: error: stray '#' in program
   41 | }#include<bits/stdc++.h>
      |  ^
a.cc:41:3: error: 'include' does not name a type
   41 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:44:5: error: redefinition of 'int main()'
   44 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
Language: C++

/*
*  Problem Link: https://atcoder.jp/contests/abc172/tasks/abc172_c
*  Author: Raunak Sett
*/
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long 
#define vi vector<int>

const int MAX = 200001;
int dp[MAX][MAX];


int books = 0;
void solve(vector<ll> a, vector<ll> b, int i, int j, ll k, int selected) {
    if (i < a.size() && j < b.size()) {
        if (dp[i][j] != -1) {
            books = max(dp[i][j], books);
            return;   
        }
    }
    if (i < a.size() && k - a[i] >= 0) {
        solve(a, b, i+1, j, k-a[i], selected + 1);
    }
    if (j < b.size() && k - b[i] >= 0) {
        solve(a, b, i, j+1, k-b[j], selected + 1);
    }
    dp[i][j] = selected;
    books = max(books, selected);
}

int main() {
    IOS
    // Code Here
    int n,m;
    cin>>n>>m;
    ll k;
    cin>>k;
    vector<ll> a(n);
    vector<ll> b(m);

    for (int i=0; i < n; i++) {
        for (int j=0; j < m; j++) {
            dp[i][j] = -1;
        }
    }

    for (int i=0; i < n; i++) {
        cin>>a[i];
    }
    for (int i=0; i < m; i++) {
        cin>>b[i];
    }

    solve(a, b, 0, 0, k, 0);
    cout<<books<<endl;
    return 0;
}

Compiler output:
/tmp/cc8J0KQI.o: in function `solve(std::vector<long long, std::allocator<long long> >, std::vector<long long, std::allocator<long long> >, int, int, long long, int)':
a.cc:(.text+0xe4): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/cc8J0KQI.o
a.cc:(.text+0xf7): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/cc8J0KQI.o
a.cc:(.text+0x348): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/cc8J0KQI.o
a.cc:(.text+0x358): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/cc8J0KQI.o
/tmp/cc8J0KQI.o: in function `main':
a.cc:(.text+0x5ed): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/cc8J0KQI.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
int a[200010],b[200010],sa[200010],sb[200010];
signed main()
{
	int n,m,k,i,maxv=0;
	cin>>n>>m>>k;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		sa[i]=sa[i-1]+a[i];
	}
	for(i=1;i<=m;i++)
	{
		cin>>b[i];
		sb[i]=sb[i-1]+b[i];
	}
	for(i=1;i<=n;i++)
	{
		if(sa[i]>k)
			break;
		maxv=max(maxv,i+upper_bound(sb+1,sb+m+1,k-sa[i])-sb-1);
	}
	cout<<maxv;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: no matching function for call to 'max(long long int&, long int)'
   23 |                 maxv=max(maxv,i+upper_bound(sb+1,sb+m+1,k-sa[i])-sb-1);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:23:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long int')
   23 |                 maxv=max(maxv,i+upper_bound(sb+1,sb+m+1,k-sa[i])-sb-1);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:23:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   23 |                 maxv=max(maxv,i+upper_bound(sb+1,sb+m+1,k-sa[i])-sb-1);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

/*
*  Problem Link: https://atcoder.jp/contests/abc172/tasks/abc172_c
*  Author: Raunak Sett
*/
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long 
#define vi vector<int>

const int MAX = 2000001;
int dp[MAX][MAX];


int books = 0;
void solve(vector<ll> a, vector<ll> b, int i, int j, ll k, int selected) {
    if (i < a.size() && j < b.size()) {
        if (dp[i][j] != -1) {
            books = max(dp[i][j], books);
            return;   
        }
    }
    if (i < a.size() && k - a[i] >= 0) {
        solve(a, b, i+1, j, k-a[i], selected + 1);
    }
    if (j < b.size() && k - b[i] >= 0) {
        solve(a, b, i, j+1, k-b[j], selected + 1);
    }
    dp[i][j] = selected;
    books = max(books, selected);
}

int main() {
    IOS
    // Code Here
    int n,m;
    cin>>n>>m;
    ll k;
    cin>>k;
    vector<ll> a(n);
    vector<ll> b(m);

    for (int i=0; i < n; i++) {
        for (int j=0; j < m; j++) {
            dp[i][j] = -1;
        }
    }

    for (int i=0; i < n; i++) {
        cin>>a[i];
    }
    for (int i=0; i < m; i++) {
        cin>>b[i];
    }

    solve(a, b, 0, 0, k, 0);
    cout<<books<<endl;
    return 0;
}

Compiler output:
/tmp/ccK9myXX.o: in function `solve(std::vector<long long, std::allocator<long long> >, std::vector<long long, std::allocator<long long> >, int, int, long long, int)':
a.cc:(.text+0xe4): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/ccK9myXX.o
a.cc:(.text+0xf7): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/ccK9myXX.o
a.cc:(.text+0x348): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/ccK9myXX.o
a.cc:(.text+0x358): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/ccK9myXX.o
/tmp/ccK9myXX.o: in function `main':
a.cc:(.text+0x5ed): relocation truncated to fit: R_X86_64_PC32 against symbol `books' defined in .bss section in /tmp/ccK9myXX.o
collect2: error: ld returned 1 exit status
Language: C++

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

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int x, y, a[n], b[m];
  for(int i { 0 }; i < n; ++i){
        cin >> a[i];
    }

    for(int i { 0 }; i < m; ++i){
        cin >> b[i];
    }

  a.insert(a.end(), b.begin(), b.end()); 
   sort(a.begin(),a.end());
  int count =0, out=0;
  for(int l=0;count <= k;l++){
    count += a[l];
    out++;
}
  cout << out <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: request for member 'insert' in 'a', which is of non-class type 'int [n]'
   18 |   a.insert(a.end(), b.begin(), b.end());
      |     ^~~~~~
a.cc:18:14: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   18 |   a.insert(a.end(), b.begin(), b.end());
      |              ^~~
a.cc:18:23: error: request for member 'begin' in 'b', which is of non-class type 'int [m]'
   18 |   a.insert(a.end(), b.begin(), b.end());
      |                       ^~~~~
a.cc:18:34: error: request for member 'end' in 'b', which is of non-class type 'int [m]'
   18 |   a.insert(a.end(), b.begin(), b.end());
      |                                  ^~~
a.cc:19:11: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   19 |    sort(a.begin(),a.end());
      |           ^~~~~
a.cc:19:21: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   19 |    sort(a.begin(),a.end());
      |                     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pi 2*asin(1.0)
 
int main() {

long N,M;
long K;
long Bread;
long Asum=0,Bsum=0;
long Answer=0;
long rest;
cin>>N>>M>>K;
vector<long> A(N);
vector<long> B(M);
vector<long> AS(N);
vector<long> BS(M);
for(int i=0;i<N;i++){
cin>>A.at(i);
Asum+=A.at(i);
AS.at(i)=Asum;
}
sort(AS.begin(),AS.end());
for(int i=0;i<M;i++){
cin>>B.at(i);
Bsum+=B.at(i);
BS.at(i)=Bsum;
}
sort(BS.begin(),BS.end());
vector<long>::iterator position;
for(int i=0;i<N;i++){
    if(AS.at(i)<K){
        rest=K-AS.at(i);
        position=upper_bound(BS.begin(),BS.end(),rest);
         Bread=distance(BS.begin(),position);                      
          if(Answer<Bread+i+1){
            Answer=Bread+i+1;
        }


    }else if(AS.at(i)==K){
        if(Answer<i+1){
            Answer=i+1;
        }
    }
}
position=upper_bound(BS.begin(),BS.end(),K);
Bread=distance(BS.begin(),position);     
if(Answer<Bread){
    Answer=Bread;
}

cout<<Answer<<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:53:20: error: expected '}' at end of input
   53 | cout<<Answer<<endl;
      |                    ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

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

typedef long long ll;
    
int n, k, t;
vector<int> v(2e5 + 100);
vector<int> a(2e5 + 100);
//vectior<vector<int>> dp(2e5 + 100, -1);
map<pair<int,int>,int> m;
rec(int indexv,int indexa,  int tt, int cnt) {
	//9if (index[
	if (m[{indexv,indexa}]) {
		return m[{indexv,indexa}];
	}
	if (tt == t) {
		return m[{indexv,indexa}] = cnt;
	}
	if (tt > t) {
		return m[{indexv,indexa}] = cnt - 1;
	}
	if (indexv >= n && indexa >= k) {
		return m[{indexv,indexa}] = 0;
	}
	int p = 0;
	if (indexv >= n) {
		p += rec(indexv,indexa + 1,tt + a[indexa], cnt + 1);
	}
	else if (indexa  >= k) {
		p += rec(indexv + 1,indexa,tt + v[indexv], cnt + 1);
	}else {
		p += max(rec(indexv + 1,indexa,tt + v[indexv], cnt + 1),rec(indexv,indexa + 1,tt + a[indexa], cnt + 1));
	}
	return m[{indexv,indexa}] = p;
	//return dp[
}



int main() {    
	cin >> n >> k >> t;

	for (int i = 0 ;i < n; ++i) {
		cin >> v[i];
	}
	for (int i = 0; i < k; ++i) {
		cin >> a[i];
	}
	cout << rec(0,0,0,0);
}








Compiler output:
a.cc:11:1: error: ISO C++ forbids declaration of 'rec' with no type [-fpermissive]
   11 | rec(int indexv,int indexa,  int tt, int cnt) {
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m,k;vector<ll>da,db;
#define pb push_back
int main()
{
	cin>>n>>m>>k;ll minno,sum=0,cnt=0;
	for(ll i=0;i<n;i++)
	{
		ll ai;cin>>ai;
		da.pb(ai);
	}
	for(ll i=0;i<m;i++)
	{
		ll ai;cin>>ai;
		db.pb(ai);
	} ll i=0,j=0;
	while(sum<k && (j<m || i<n))
	{
		
		if(i>=n && j>=m)break;
		if(i<n && j<m)
		{
			minno=min(da[i],db[j]);
			if(minno==da[i]){sum+=minno;cnt++; i++;}
			else if (minno==db[j]) {sum+=minno;cnt++;j++;}
		}
		else if(i<n)
			sum+da[i];i++;cnt++;
		else
			sum+=db[j];j++;cnt++;
	}
	cout<<cnt<<endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'else' without a previous 'if'
   31 |                 else
      |                 ^~~~
Language: C++

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

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int x, y, a[n], b[m];
  for(int i { 0 }; i < n; ++i){
        cin >> a[i];
    }

    for(int i { 0 }; i < m; ++i){
        cin >> b[i];
    }

  a.insert(a.end(), b.begin(), b.end()); 
   sort(a.begin(),a.end());
  int count =0, out=0;
  for(int l=0;count <= k;l++){
    count += a[l];
    out++;
}
  cout << out <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: request for member 'insert' in 'a', which is of non-class type 'int [n]'
   16 |   a.insert(a.end(), b.begin(), b.end());
      |     ^~~~~~
a.cc:16:14: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   16 |   a.insert(a.end(), b.begin(), b.end());
      |              ^~~
a.cc:16:23: error: request for member 'begin' in 'b', which is of non-class type 'int [m]'
   16 |   a.insert(a.end(), b.begin(), b.end());
      |                       ^~~~~
a.cc:16:34: error: request for member 'end' in 'b', which is of non-class type 'int [m]'
   16 |   a.insert(a.end(), b.begin(), b.end());
      |                                  ^~~
a.cc:17:11: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   17 |    sort(a.begin(),a.end());
      |           ^~~~~
a.cc:17:21: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   17 |    sort(a.begin(),a.end());
      |                     ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int N,M,K;
    std::cin >> N >> M >> K;
    stack<int> A;
    for(int i = 0;i < N;i++ ){
        int tmp;
        std::cin >> tmp;
        A.push(tmp);
    }
    stack<int> B;
    for(int i = 0;i < M;i++ ){
        int tmp;
        std::cin >> tmp;
        B.push(tmp);
    }
    while(Count < K){
        if(A.empty()==0){
            if(B.empty() == 0 && B.top > A.top()){
                B.pop();
                Count++;
            }else{
                A.pop();
                Count++;
            }
        }else if(B.empty() == 0){
            if(A.empty() == 0 && A.top > B.top()){
                A.pop();
                Count++;
            }else{
                B.pop();
                Count++;
            }
        }else{
            break;
        }
    }
    std::cout << Count << std::endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'stack' was not declared in this scope
    6 |     stack<int> A;
      |     ^~~~~
a.cc:2:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    1 | #include<iostream>
  +++ |+#include <stack>
    2 | using namespace std;
a.cc:6:11: error: expected primary-expression before 'int'
    6 |     stack<int> A;
      |           ^~~
a.cc:10:9: error: 'A' was not declared in this scope
   10 |         A.push(tmp);
      |         ^
a.cc:12:11: error: expected primary-expression before 'int'
   12 |     stack<int> B;
      |           ^~~
a.cc:16:9: error: 'B' was not declared in this scope
   16 |         B.push(tmp);
      |         ^
a.cc:18:11: error: 'Count' was not declared in this scope
   18 |     while(Count < K){
      |           ^~~~~
a.cc:19:12: error: 'A' was not declared in this scope
   19 |         if(A.empty()==0){
      |            ^
a.cc:20:16: error: 'B' was not declared in this scope
   20 |             if(B.empty() == 0 && B.top > A.top()){
      |                ^
a.cc:27:18: error: 'B' was not declared in this scope
   27 |         }else if(B.empty() == 0){
      |                  ^
a.cc:39:18: error: 'Count' was not declared in this scope
   39 |     std::cout << Count << std::endl;
      |                  ^~~~~
Language: Java

//package atcoder.beginner_172;

import java.io.*;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main_C {

    public static void main (String[] args) throws Exception {

        String s = "3 4 6\n" +
                "2 2 5\n" +
                "3 1 1 1";

//        br = new BufferedReader(new StringReader(s));
        br = new BufferedReader(new InputStreamReader(System.in));
        bw = new BufferedWriter(new OutputStreamWriter(System.out));

        rl(); int N=nin(), M=nin(), K=nin();
        rl(); long A[]=new long[N]; A[0] = nlo(); for (int i=1; i<N; ++i) A[i]=A[i-1]+nin();
        rl(); long B[]=new long[M]; B[0] = nlo(); for (int i=1; i<M; ++i) B[i]=B[i-1]+nin();

        int c=Arrays.binarySearch(B, K);
        if (c<0) c=-c+2;
        for (int i=0; i<N && A[i]<=K; ++i) {
            int j=Arrays.binarySearch(B, K-A[i]);
            if (j<0) j=-j-1;
            c=Math.max(c, i+j+2);
        }

        bw.write(Integer.toString(c));
        bw.newLine();
        bw.flush();

    }

    static BufferedReader br;
    static BufferedWriter bw;
    static StringTokenizer st;
    static void rl() throws Exception{
        st = new StringTokenizer(br.readLine());
    }
    static long nlo(){
        return Long.parseLong(st.nextToken());
    }
    static int nin(){
        return Integer.parseInt(st.nextToken());
    }
    /*private static void te(){
      }*/
    static double ndo(){
        return Double.parseDouble(st.nextToken());
    }
    static char[] nca(){
        return st.nextToken().toCharArray();
    }
    static String nstr(){
        return st.nextToken();
    }
}

Compiler output:
Main.java:8: error: class Main_C is public, should be declared in a file named Main_C.java
public class Main_C {
       ^
1 error