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

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

int main() {
  int N, M, K;
  cin >> N >> M >> K;
  vector<int> vecA = {};
  vector<int> vecB = {};
  int A, B;
  int counter = 0;
  int Time = 0;
  for (int i = 0; i < N; i++) {
    cin >> A;
    vecA.at(N-i-1) = A;
  }
  for (int i = 0; i < M; i++) {
    cin >> B;
    vecB.at(M-i-1) = B;
  }
  for (int i = 0; i < N + M; i++) {
    int p;
    p = size.vecA();
    int q;
    q = size.vecB();
    if (vecA.at(p - 1) <= vecB.at(q - 1)) {
      Time += vecA.at(p - 1);
      counter++;
      vecA.pop_back();
      if (Time > K)
        break;
      continue;
    }
    if (vecA.at(p - 1) <= vecB.at(q - 1)) {
      Time += vecB.at(q - 1);
      counter++;
      vecB.pop_back();
      if (Time > K)
        break;
      continue;
    }
  }
  cout << counter << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: overloaded function with no contextual type information
   22 |     p = size.vecA();
      |              ^~~~
a.cc:24:14: error: overloaded function with no contextual type information
   24 |     q = size.vecB();
      |              ^~~~
Language: C++

#include <cmath>
#include <iostream>
#include <functional>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <iomanip>
#include <math.h>
#include <list>
#include <numeric>
using namespace std;

long long combi(long long n, long long k) {
  if (n == k || k == 0)
    return 1;
  else {
    return combi(n - 1, k - 1) + combi(n - 1, k);
  }
}

long long gcd(int a, int b){
  if (a%b == 0){
    return(b);
  }
  else{
    return(gcd(b, a%b));
  }
}

int main(){
  long long N,M,K;
  cin >> N >> M >> K;
  long long A[N],B[M],count=0,ans=0;

  for(int i=0;i<N;i++){
    cin >> A[i];
  }
  for(int i=0;i<M;i++){
    cin >> B[i];
  }
  int i=0,j=0,J=0;
  while(count<=K && J=0){
    ans++;
    if(A[i]<B[j] && i!=N){
      count += A[i];
      i++;
    }
    else if(j!=M){
      count += B[j];
      j++;
    }
    if(i==N && j==M){
      J=1;
    }
    //cout << count << endl;
  }
  if(count>K){
  cout << ans-1 << endl;
  }
  else{
  cout << ans << endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:18: error: lvalue required as left operand of assignment
   44 |   while(count<=K && J=0){
      |         ~~~~~~~~~^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    
           int n,m,k;
           cin >>n>>m>>k;

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

  while(sumtime < k && u+j != n+m ){
    if(u < n && j < m){
  if(A.at(u) >= B.at(j) ){
    					sumtime += B.at(j);
						j++;
                        cnt++;}
    if(A.at(u) 　<　B.at(j) ){
    sumtime += A.at(u);
    u++;
    cnt++;}

    }
  if(u==n){
    sumtime += B[j];
    j++;
    cnt++;
  }
    if(j==m){
      sumtime += A[u];
    u++;
    cnt++;
    }
    
  }

 if(u+j==n+m){
   cout << cnt <<endl;}   
 if(sumtime > k){
  cout << cnt - 1 <<endl;}
  
}

Compiler output:
a.cc:28:16: error: extended character 　 is not valid in an identifier
   28 |     if(A.at(u) 　<　B.at(j) ){
      |                ^
a.cc:28:19: error: extended character 　 is not valid in an identifier
   28 |     if(A.at(u) 　<　B.at(j) ){
      |                   ^
a.cc: In function 'int main()':
a.cc:28:15: error: expected ')' before '\U00003000'
   28 |     if(A.at(u) 　<　B.at(j) ){
      |       ~       ^~~
      |               )
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 minute = 0;
    int Acount = 0;
    int Bcount = 0;
    while(minute <= K && Count < N + M{
        if(Acount + 1 <= N){
            if(Bcount + 1 <= M && B[Bcount] < A[Acount]){
                minute += B[Bcount];
                Bcount++;  
                Count++;
            }else{
                minute += A[Acount];
                Acount++;
                Count++;
            }
        }else if(Bcount + 1 <= M){
            if(Acount + 1 <= N && A[Acount] < B[Bcount]){
                minute += A[Acount];
                Acount++;
                Count++;
            }else{
                minute += B[Bcount];
                Bcount++;
                Count++;
            }
        }else{
            break;
        }
    }
    if(minute > K) Count--;
    std::cout << Count  << std::endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:39: error: expected ')' before '{' token
   19 |     while(minute <= K && Count < N + 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 minute = 0;
    int Acount = 0;
    int Bcount = 0;
    while(minute <= K && count < A.size() + B.size()){
        if(Acount + 1 <= N){
            if(Bcount + 1 <= M && B[Bcount] < A[Acount]){
                minute += B[Bcount];
                Bcount++;  
                Count++;
            }else{
                minute += A[Acount];
                Acount++;
                Count++;
            }
        }else if(Bcount + 1 <= M){
            if(Acount + 1 <= N && A[Acount] < B[Bcount]){
                minute += A[Acount];
                Acount++;
                Count++;
            }else{
                minute += B[Bcount];
                Bcount++;
                Count++;
            }
        }else{
            break;
        }
    }
    if(minute > K) Count--;
    std::cout << Count  << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: 'count' was not declared in this scope; did you mean 'Count'?
   18 |     while(minute <= K && count < A.size() + B.size()){
      |                          ^~~~~
      |                          Count
a.cc:18:36: error: request for member 'size' in 'A', which is of non-class type 'int [N]'
   18 |     while(minute <= K && count < A.size() + B.size()){
      |                                    ^~~~
a.cc:18:47: error: request for member 'size' in 'B', which is of non-class type 'int [M]'
   18 |     while(minute <= K && count < A.size() + B.size()){
      |                                               ^~~~
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
      	int b = Integer.parseInt(sc.next());
      	int k = Integer.parseInt(sc.next());
      	int[] aList = new int[a];
      	int[] bList = new int[b];
      	for(int cnt = 0;cnt < aList.length;cnt++){
        	aList[cnt] = Integer.parseInt(sc.next());
        }
      	for(int cnt = 0;cnt < bList.length;cnt++){
        	bList[cnt] = Integer.parseInt(sc.next());
        }
      	int aCount = 0;
      	int bCount = 0;
      	int ans = 0;
      	long total = 0;
      	
      	for(int i = 0;i < a + b;i++){
          	if(aCount != a - 1 || bCount != b - 1){
            	if(aList[aCount] <= bList[bCount]){
                  total += aList[aCount];
                  if(aCount < a - 1){
                      aCount++;
                  }
                  ans++;
              }else{
                  total += bList[bCount];
                  if(bCount < b - 1){
                      bCount++;
                  }
                  ans++;
              }
              if(k < total + aList[aCount] || k < total + bList[bCount]){
            		break;
           	  }
            }else{
            	if(aCount == a - 1){
                	for(int i = bCount;i < bList.length;i++){
                    	save += bList[i];
                      	ans++;
                    }
                }else{
                	for(int i = aCount;i < aList.length;i++){
                    	save += aList[i];
                      	ans++;
                    }
                }
              	if(k < total + save){
                	break;
                }
            }
        }
      	System.out.println(ans);
	}
}

Compiler output:
Main.java:42: error: variable i is already defined in method main(String[])
                	for(int i = bCount;i < bList.length;i++){
                	        ^
Main.java:43: error: cannot find symbol
                    	save += bList[i];
                    	^
  symbol:   variable save
  location: class Main
Main.java:47: error: variable i is already defined in method main(String[])
                	for(int i = aCount;i < aList.length;i++){
                	        ^
Main.java:48: error: cannot find symbol
                    	save += aList[i];
                    	^
  symbol:   variable save
  location: class Main
Main.java:52: error: cannot find symbol
              	if(k < total + save){
              	               ^
  symbol:   variable save
  location: class Main
5 errors
Language: C++

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

int64_t mn(int64_t a,int64_t b){
  if(a>b){return b;}else{return a;}
}

int main() {
  int64_t N,M,K;
  cin>>N>>M>>K;
  
  vector<int64_t> A(N+1);
  rep(i,N){cin >> A.at(i);}
  A.at(N)=10000000000001;
  
  vector<int64_t> B(M+1);
  rep(i,M){cin >> B.at(i);}
  B.at(M)=10000000000001;
  
  int i,j;
  i=0;
  j=0;
  
  while(true){
  if(mn(A.at(i),B.at(j))>K){break;}
    if(A.at(i)>B.at(j)){K=K-B.at(j);j++;}else{K=K-A.at(i);i++;}
  }
cout<<i+j<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   rep(i,N){cin >> A.at(i);}
      |       ^
a.cc:13:3: error: 'rep' was not declared in this scope
   13 |   rep(i,N){cin >> A.at(i);}
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
//int r=1e9;
int main()
{
  int N,M,K;
  int a[5000],b[5000],i;
  int sum=0;
  int count=0;
  cin>>N >>M >>K;
  for(i=0;i<N;i++)
  {
    cin>>a[i];
  }
  for(i=0;i<M;i++)
  {
  cin>>b[i];
  }
  for(i=0;(i<N)||(i<M);i++)
  {
   if(a[i]<K)
   {
    
     if(k>(a[i]+sum))
     {
     sum=sum+a[i];
       count++;
     }
     
   }
     if(b[i]<K)
   {
     if(k>(sum+b[i]))
     {
     sum=sum+b[i];
       count++;
     }
   }
  }
  cout<<count;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'k' was not declared in this scope
   24 |      if(k>(a[i]+sum))
      |         ^
a.cc:33:9: error: 'k' was not declared in this scope
   33 |      if(k>(sum+b[i]))
      |         ^
Language: Java

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

public class A {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        long k = sc.nextLong();


        List<Long> A = new ArrayList<>();
        List<Long> B = new ArrayList<>();

        for(int i = 0; i < n; i++){
            long A_i = sc.nextLong();
            A.add(A_i);
        }

        for(int i = 0; i < m; i++){
            long B_i = sc.nextLong();
            B.add(B_i);
        }

        int ans = 0;


        while(true){

            //本が無くなったら終わり
            if(A.size() == 0 && B.size() == 0){
                break;
            }

            if(A.size() > 0 && B.size() == 0) {//Aしか残ってない
                long initialA = A.get(0);
                if(k >= initialA){
                    k = k - initialA;
                    A.remove(0);
                    ans++;
                }else {//Aを読めなくなったら終わり
                    break;
                }
            }else if(A.size() == 0 && B.size() > 0){//Bしか残ってない
                long initialB = B.get(0);
                if(k >= initialB){
                    k = k - initialB;
                    B.remove(0);
                    ans++;
                }else {//Bを読めなくなったら終わり
                    break;
                }
            }else { //両方残っている
                long initialA = A.get(0);
                long initialB = B.get(0);

                //どの本を読むことも不可能になったら終わり
                if(k < initialA && k < initialB){
                    break;
                }

                //ここに来た時点でどちらかは読める
                //AとB小さい方を選ぶ
                if(initialA < initialB) {//Aのが小さい
                    k = k - initialA;
                    A.remove(0);
                    if(k < 0){
                        break;
                    }
                    ans++;
                }else if(initialA > initialB) {//Bのが小さい
                    k = k - initialB;
                    B.remove(0);
                    if(k < 0){
                        break;
                    }
                    ans++;
                }
            }

        }
        System.out.println(ans);
    }
}


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

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

int main() {
  int N, M, K;
  cin >> N >> M >> K;
  vector<int> vecA = {};
  vector<int> vecB = {};
  int A, B;
  int counter = 0;
  int Time = 0;
  for (int i = 0; i < N; i++) {
    cin >> A;
    vecA.at(N-i-1) = A;
  }
  for (int i = 0; i < M; i++) {
    cin >> B;
    vecB.at(M-i-1) = B;
  }
  for (int i = 0; i < N + M; i++) {
    int p = size.vecA();
    int q = size.vecB();
    if (vecA.at(p - 1) <= vecB.at(q - 1)) {
      Time += vecA.at(p - 1);
      counter++;
      vecA.pop_back();
      if (Time > K)
        break;
      continue;
    }
    if (vecA.at(p - 1) <= vecB.at(q - 1)) {
      Time += vecB.at(q - 1);
      counter++;
      vecB.pop_back();
      if (Time > K)
        break;
      continue;
    }
  }
  cout << counter << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: overloaded function with no contextual type information
   21 |     int p = size.vecA();
      |                  ^~~~
a.cc:22:18: error: overloaded function with no contextual type information
   22 |     int q = size.vecB();
      |                  ^~~~
Language: C++

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

#define FOR(i, a, n) for(int i = a; i < n; ++i)
#define logarr(arr) for(auto i : arr) { cout << i << " "; } cout << "\n";
#define ll long long
#define sc(a) scanf("%d", &a);
#define scl(a) scanf("%lld", &a);


void solve() {

    int n, m, k;
    cin >> n >> m >> k;
    stack<int> a, b;

    FOR(i, 0, n) {
        int val; cin >> val;
        a.push(val);
    }
    FOR(i, 0, m) {
        int val; cin >> val;
        b.push(val);
    }
    FOR(i, 0, n+m) {
        int some;
        if (!a.empty() && !b.empty())
            some = min(a.top(), b.top());
        else if (a.empty() && !b.empty()) 
            some = b.top();
        else if (!a.empty() && b.empty())
            some = a.top();
        else
            break;
        if (k - some < 0)
            break;
        else {
            ans++;
            k -= some;
            if (some == a[0])
                a.pop();
            else
                b.pop();
        }
    }
    cout << ans << "\n";

}


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

	int t = 1;
	// sc(t); 
	while(t--) {
		solve();
	}

	return 0;

}
// g++ -std=c++17 -o solve solve.cpp


Compiler output:
a.cc: In function 'void solve()':
a.cc:38:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |             ans++;
      |             ^~~
      |             abs
a.cc:40:26: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int')
   40 |             if (some == a[0])
      |                          ^
a.cc:46:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |     cout << ans << "\n";
      |             ^~~
      |             abs
Language: C++

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

int main() {
  int N, M, K;
  cin >> N >> M >> K;
  vector<int> vecA = {};
  vector<int> vecB = {};
  int A, B;
  int counter = 0;
  int time = 0;
  for (int i = 0; i < N; i++) {
    cin >> A;
    vecA.at(N-i-1) = A;
  }
  for (int i = 0; i < M; i++) {
    cin >> B;
    vecB.at(M-i-1) = B;
  }
  for (int i = 0; i < N + M; i++) {
    int p = size.vecA();
    int q = size.vecB();
    if (vecA.at(p - 1) <= vecB.at(q - 1))) {
      time += vecA.at(p - 1);
      counter++;
      vecA.pop_back();
      if (time > K)
        break;
      continue;
    }
    if (vecA.at(p - 1) <= vecB.at(q - 1))) {
      time += vecB.at(q - 1);
      counter++;
      vecB.pop_back();
      if (time > K)
        break;
      continue;
    }
  }
  cout << counter << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: overloaded function with no contextual type information
   21 |     int p = size.vecA();
      |                  ^~~~
a.cc:22:18: error: overloaded function with no contextual type information
   22 |     int q = size.vecB();
      |                  ^~~~
a.cc:23:42: error: expected primary-expression before ')' token
   23 |     if (vecA.at(p - 1) <= vecB.at(q - 1))) {
      |                                          ^
a.cc:31:42: error: expected primary-expression before ')' token
   31 |     if (vecA.at(p - 1) <= vecB.at(q - 1))) {
      |                                          ^
Language: Java

#include <bits/stdc++.h>

using namespace std;

void solve(){
	long long int n, m, k; cin>>n>>m>>k;
	long long 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];
	}
	long long int i = 0, j = 0;
	int ans = 0;
	bool ok = true;
	while(i < n && j < m){
		if(a[i] <= b[j]){
			if((k-a[i])>=0){
				k-=a[i];
				ans++;
			} else {
				ok = false;
				break;
			}
			i++;
		} else {
			if((k-b[j])>=0){
				k-=b[j];
				ans++;
			} else {
				ok = false;
				break;
			}
			j++;
		}
	}
	if(ok){
		while(i < n && (k-a[i])>=0){
			k-=a[i];
			i++;
			ans++;
		}
		while(j < m && (k-b[j])>=0){
			k-=b[j];
			j++;
			ans++;
		}
	}
	cout << ans << "\n";
}

int main(){
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t=1;
	while(t--){
		solve();
	}
	return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:6: error: not a statement
	long long int n, m, k; cin>>n>>m>>k;
	^
Main.java:6: error: not a statement
	long long int n, m, k; cin>>n>>m>>k;
	     ^
Main.java:6: error: not a statement
	long long int n, m, k; cin>>n>>m>>k;
	                                ^
Main.java:7: error: not a statement
	long long int a[n], b[m];
	^
Main.java:7: error: not a statement
	long long int a[n], b[m];
	     ^
Main.java:7: error: not a statement
	long long int a[n], b[m];
	                ^
Main.java:7: error: not a statement
	long long int a[n], b[m];
	                     ^
Main.java:9: error: not a statement
		cin>>a[i];
		   ^
Main.java:12: error: not a statement
		cin>>b[i];
		   ^
Main.java:14: error: not a statement
	long long int i = 0, j = 0;
	^
Main.java:14: error: not a statement
	long long int i = 0, j = 0;
	     ^
Main.java:50: error: not a statement
	cout << ans << "\n";
	            ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
void solve(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: ';' expected
	long long int n, m, k; cin>>n>>m>>k;
	    ^
Main.java:6: error: ';' expected
	long long int n, m, k; cin>>n>>m>>k;
	         ^
Main.java:7: error: ';' expected
	long long int a[n], b[m];
	    ^
Main.java:7: error: ';' expected
	long long int a[n], b[m];
	         ^
Main.java:7: error: ';' expected
	long long int a[n], b[m];
	                 ^
Main.java:14: error: ';' expected
	long long int i = 0, j = 0;
	    ^
Main.java:14: error: ';' expected
	long long int i = 0, j = 0;
	         ^
Main.java:54: error: illegal character: '#'
	#ifndef ONLINE_JUDGE
	^
Main.java:57: error: illegal character: '#'
	#endif
	^
Main.java:54: error: ';' expected
	#ifndef ONLINE_JUDGE
	                    ^
Main.java:58: error: ';' expected
	ios_base::sync_with_stdio(false);
	        ^
26 errors
Language: C++


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

using namespace std;

int main(){
  ios::sync_with_stdio ( false );
  cin.tie ( 0 );
  cout.tie ( 0 );
  deque<int> a;
  deque<int> b;
  int n,m,k,c,now=0,j=0;
  cin >> n >> m >> k;
  while(n--){
    cin >> c;
    a.push_back(c);
  }
  while(m--){
    cin >> c;
    b.push_back(c);
  }
  while(a.size()>0||b.size()>0){
    if(a.front<b.front){
      if(now+a.front>k)    
        break;
      now+=a.front;
      a.pop_front();  
      j++;
    }
    else{
      if(now+b.front>k)    
        break;
      now+=b.front;
      b.pop_front();
      j++;
    }
  }
  cout << j;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:15: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator<'
   27 |     if(a.front<b.front){
      |        ~~~~~~~^~~~~~~~
      |          |       |
      |          |       <unresolved overloaded function type>
      |          <unresolved overloaded function type>
a.cc:28:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator+'
   28 |       if(now+a.front>k)
      |          ~~~^~~~~~~~
      |          |     |
      |          int   <unresolved overloaded function type>
a.cc:30:14: error: invalid use of member function 'std::deque<int>::front' (did you forget the '()' ?)
   30 |       now+=a.front;
      |            ~~^~~~~
a.cc:35:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator+'
   35 |       if(now+b.front>k)
      |          ~~~^~~~~~~~
      |          |     |
      |          int   <unresolved overloaded function type>
a.cc:37:14: error: invalid use of member function 'std::deque<int>::front' (did you forget the '()' ?)
   37 |       now+=b.front;
      |            ~~^~~~~
Language: C++

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

int main (void){
  long long int n,m,k,ans = 0,s = 0,t = 0,o = 1;
  cin >> n >> m >> k;

  vector<long long int> a(n,0);
  vector<long long int> b(m,0);

  for(int i = 0;i < n;i++){
    cin >> a[i];
  }
  for(int i = 0;i < m;i++){
    cin >> b[i];
  }
  if(k < a[0] && k < b[0]){
    cout << "0\n";
    return 0;
  }

  while(o == 1){
    if(a[s] > b[t] && s < n && t < m){
      k = k - b[t];
      t++;
      ans++;
    }else if(b[t] > a[s] && s < n && t < m){
      k = k - a[s];
      s++;
      ans++;
    }else if(b[t] == a[s]){
      if((n - s) >= (m - t)){
        k = k - a[s];
        s++;
        ans++;
      }else{
        k = k - b[t];
        t++;
        ans++;
    }else if(s >= n){
      k = k - b[t];
      t++;
      ans++;
    }else if(t >= m){
      k = k - a[s];
      s++;
      ans++;
    }
    if(k < 0){
      ans--;
      o = 0;
    }
    if(s >= n && t >= m){
      o = 0;
    }
  }

  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:6: error: expected '}' before 'else'
   40 |     }else if(s >= n){
      |      ^~~~
a.cc:31:27: note: to match this '{'
   31 |     }else if(b[t] == a[s]){
      |                           ^
Language: C++

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

int main() {
  int N, M, K;
  cin >> N >> M >> K;
  vector<int> vecA(N);
  vector<int> vecB(M);
  int A, B;
  int counter = 0;
  int time = 0;
  for (int i = 0; i < N; i++) {
    cin >> A;
    vecA.at(N-i-1) = A;
  }
  for (int i = 0; i < M; i++) {
    cin >> B;
    vecB.at(M-i-1) = B;
  }
  for (int i = 0; i < N + M; i++) {
    int p = size.vecA();
    int q = size.vecB();
    if (vecA.at(p - 1) <= vecB.at(q - 1))) {
      time += vecA.at(p - 1);
      counter++;
      vecA.pop_back();
      if (time > K)
        break;
      continue;
    }
    if (vecA.at(p - 1) <= vecB.at(q - 1))) {
      time += vecB.at(q - 1);
      counter++;
      vecB.pop_back();
      if (time > K)
        break;
      continue;
    }
  }
  cout << counter << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: overloaded function with no contextual type information
   21 |     int p = size.vecA();
      |                  ^~~~
a.cc:22:18: error: overloaded function with no contextual type information
   22 |     int q = size.vecB();
      |                  ^~~~
a.cc:23:42: error: expected primary-expression before ')' token
   23 |     if (vecA.at(p - 1) <= vecB.at(q - 1))) {
      |                                          ^
a.cc:31:42: error: expected primary-expression before ')' token
   31 |     if (vecA.at(p - 1) <= vecB.at(q - 1))) {
      |                                          ^
Language: C

#include<stdio.h>

int main(){
    int n, m;
    long int k;
    scanf("%d%d%ld", &n, &m, &k);
    long int a[n], b[m];
    for(int i = 0; i < n; i++){
        scanf("%ld", &a[i]);
        
    }
    
    for(int i = 0; i < m; i++){
        scanf("%ld", &b[i]);
    }
    long int minute = 0, ans = 0;
    int i =0, j = 0;
    while(minute <= k){
        if(a[i] <= b[j]||b[j] == NULL){
            minute = minute + a[i];
            i++;
        }
        else if(a[i] > b[j]||a[i] == NULL){
            minute = minute + b[j];
            j++;
        }       
        if(minute <= k){
            ans++;
        } 
        if(*a[i] == NULL && *b[j] == NULL){break;}
        
    }
    printf("%ld", ans);
    return 0;
}    


Compiler output:
main.c: In function 'main':
main.c:19:31: warning: comparison between pointer and integer
   19 |         if(a[i] <= b[j]||b[j] == NULL){
      |                               ^~
main.c:23:35: warning: comparison between pointer and integer
   23 |         else if(a[i] > b[j]||a[i] == NULL){
      |                                   ^~
main.c:30:12: error: invalid type argument of unary '*' (have 'long int')
   30 |         if(*a[i] == NULL && *b[j] == NULL){break;}
      |            ^~~~~
main.c:30:29: error: invalid type argument of unary '*' (have 'long int')
   30 |         if(*a[i] == NULL && *b[j] == NULL){break;}
      |                             ^~~~~
Language: C++

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

int main() {
  long long N, M, K;
  cin >> N >> M >> K;
  vector<long long> A(N);
  vector<long long> B(M);
  int cnt = 0;
  int P = 0;
  int Q = 0;
  for(int i = 0; i < N; i++) {
    cin >> A.at(i);
    Q += A.at(i);
  }
  for(int i = 0; i < M; i++) {
    cin >> B.at(i);
    Q += B.at(i);
  }
  if(Q <= K) {
    cout << N+M << endl
  }
  else {
  int s,t = 0;
  for(int i = 0; i < N+M; i++) {
    if(s == N) {
      for(int j =t; j < M; j++) {
      P += B.at(t);
      if(P <= K) {
        cnt++;
        t++;
      } 
      else {
        break;
      }
      }
    }
    else if(t == M) {
      for(int j =s; j < N; j++) {
      P += A.at(s);
      if(P <= K) {
        cnt++;
        s++;
      } 
      else {
        break;
      }
      }
    }
    else if(A.at(s) <= B.at(t)) {
      P += A.at(s);  
      if(P <= K) {
        cnt++;
        s++;
      }
      else {
        break;
      }
    }
    else if(A.at(s) > B.at(t)) {
      P += B.at(t);
      if(P <= K) {
        cnt++;
        t++;
      } 
      else {
        break;
      }
    }
  }
  cout << cnt << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: expected ';' before '}' token
   21 |     cout << N+M << endl
      |                        ^
      |                        ;
   22 |   }
      |   ~
Language: C++


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

using namespace std;

int main(){
  ios::sync_with_stdio ( false );
  cin.tie ( 0 );
  cout.tie ( 0 );
  deque<int> a,b;
  int n,m,k,c,now=0,j=0;
  cin >> n >> m >> k;
  while(n--){
    cin >> c;
    a.push_back(c);
  }
  while(m--){
    cin >> c;
    b.push_back(c);
  }
  while(a.size()>0||b.size()>0){
    if(a.front<b.front){
      if(now+a.front>k)    
        break;
      now+=a.front;
      a.pop_front();  
      j++;
    }
    else{
      if(now+b.front>k)    
        break;
      now+=b.front;
      b.pop_front();
      j++;
    }
  }
  cout << j;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator<'
   26 |     if(a.front<b.front){
      |        ~~~~~~~^~~~~~~~
      |          |       |
      |          |       <unresolved overloaded function type>
      |          <unresolved overloaded function type>
a.cc:27:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator+'
   27 |       if(now+a.front>k)
      |          ~~~^~~~~~~~
      |          |     |
      |          int   <unresolved overloaded function type>
a.cc:29:14: error: invalid use of member function 'std::deque<int>::front' (did you forget the '()' ?)
   29 |       now+=a.front;
      |            ~~^~~~~
a.cc:34:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator+'
   34 |       if(now+b.front>k)
      |          ~~~^~~~~~~~
      |          |     |
      |          int   <unresolved overloaded function type>
a.cc:36:14: error: invalid use of member function 'std::deque<int>::front' (did you forget the '()' ?)
   36 |       now+=b.front;
      |            ~~^~~~~
Language: C++

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

int main() {
  int N, M, K;
  cin >> N >> M >> K;
  vector<int> vecA(N);
  vector<int> vecB(M);
  int A, B;
  int counter = 0;
  int time = 0;
  for (int i = 0; i < N; i++) {
    cin >> A;
    vecA.at(N-i-1) = A;
  }
  for (int i = 0; i < M; i++) {
    cin >> B;
    vecB.at(M-i-1) = B;
  }
  for (int i = 0; i < N + M; i++) {
    if (vecA.at(size.vecA() - 1) <= vecB.at(size.vecB() - 1))) {
      time += vecA.at(size.vecA() - 1);
      counter++;
      vecA.pop_back();
      if (time > K)
        break;
    }
    if (vecA.at(size.vecA() - 1) <= vecB.at(size.vecB() - 1))) {
      time += vecB.at(size.vecB() - 1);
      counter++;
      vecB.pop_back();
      if (time > K)
        break;
    }
  }
  cout << counter << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: overloaded function with no contextual type information
   21 |     if (vecA.at(size.vecA() - 1) <= vecB.at(size.vecB() - 1))) {
      |                      ^~~~
a.cc:21:50: error: overloaded function with no contextual type information
   21 |     if (vecA.at(size.vecA() - 1) <= vecB.at(size.vecB() - 1))) {
      |                                                  ^~~~
a.cc:21:62: error: expected primary-expression before ')' token
   21 |     if (vecA.at(size.vecA() - 1) <= vecB.at(size.vecB() - 1))) {
      |                                                              ^
a.cc:28:22: error: overloaded function with no contextual type information
   28 |     if (vecA.at(size.vecA() - 1) <= vecB.at(size.vecB() - 1))) {
      |                      ^~~~
a.cc:28:50: error: overloaded function with no contextual type information
   28 |     if (vecA.at(size.vecA() - 1) <= vecB.at(size.vecB() - 1))) {
      |                                                  ^~~~
a.cc:28:62: error: expected primary-expression before ')' token
   28 |     if (vecA.at(size.vecA() - 1) <= vecB.at(size.vecB() - 1))) {
      |                                                              ^
Language: Java

import java.util.Scanner;

public class C {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int ans = 0;
		int N = scan.nextInt();
		int M = scan.nextInt();
		int K = scan.nextInt();
		int[] A = new int[N + 1];
		int[] B = new int[M + 1];
		int Acount = 0;
		int Bcount = 0;

		for(int i = 0;i < N;i++) {
			A[i] = scan.nextInt();
		}

		for(int i = 0;i < M;i++) {
			B[i] = scan.nextInt();
		}

		A[N] = 1000000001;
		B[M] = 1000000001;

		while(true) {
			if(A[Acount] > B[Bcount]) {
				K -= B[Bcount];
				Bcount++;
			}else {
				K -= A[Acount];
				Acount++;
			}

			if(K < 0 || (Acount == N && Bcount == M)) {
				break;
			}

			ans++;
		}

		System.out.println(ans);

	}
}

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

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

int main()
{
    int n, m;
    int k;
    vector <int> a(n), b(m);
    int ans = 0;

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

    int time=0;
    for (int num = 0; num <= m; num++) {
        int karians = 0;
        for (int i = 0; num != 0 && time <= k; i++) {
            time += b[i];
            num--;

            karians += 1;
        }
        for (int i = 0; time <= k; i++) {
            time += a[i];

            karians += i;
        }

        if (ans < karians) {
            ans = karians;
        }
    }

    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'vectorin' was not declared in this scope
   19 |     vectorin(b);
      |     ^~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define LOOP(i, N) for (int i = 1; i <= (int)N; i++)
#define RREP(i, N) for (int i =(int)N-1; i >= 0; i--)
#define RLOOP(i, N) for (int i =(int)N; i > 0; i--)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define pb push_back

typedef long long ll;

typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
//cout<<"Yes"<<endl;
//cout<<"No"<<endl;

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll n,m,k;
ll ans=0;
vector <ll> a;
vector <ll> b;
int dfs(int i,int ai,int bi,int sum){
    if(sum>k)return i;
    ll tmp;
    if(sum+a[ai]<=k&&ai<n){
      tmp=dfs(i+1,ai+1,bi,sum+a[ai]);
        c.pb(tmp);
        if(tmp>ans)ans=tmp;
    }
    if(sum+b[bi]<=k&&bi<m){
      tmp=dfs(i+1,ai,bi+1,sum+b[bi]);
        if(tmp>ans)ans=tmp;
    }
    return i;
}
    
int main(){
    cin>>n>>m>>k;
    REP(i,n){
        int tmp;
        cin>>tmp;
        a.pb(tmp);
    }
    REP(i,m){
        int tmp;
        cin>>tmp;
        b.pb(tmp);
    }
    a.pb(INF);
    b.pb(INF);
    ll i=dfs(0,0,0,0);
    cout<<ans<<endl;
    //sort(ALL(c));
    /*if(c.empty()!=1){
        cout<<c[c.size()-1]<<endl;
    }else{
        cout<<0<<endl;
    }
    */
}


Compiler output:
a.cc: In function 'int dfs(int, int, int, int)':
a.cc:33:9: error: 'c' was not declared in this scope
   33 |         c.pb(tmp);
      |         ^
Language: Java



public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n, m;
        long k;
        n = sc.nextInt(); m = sc.nextInt(); k = sc.nextLong();
        sc.nextLine();
        int i;
        long N[] = new long[n];
        long M[] = new long[m];
        for(i = 0; i < n; i++) N[i] = sc.nextLong();
        sc.nextLine();
        for(i = 0; i < m; i++) M[i] = sc.nextLong();
        sc.nextLine();
        
        long limit = 0;
        int ntop = 0, mtop = 0;
        while(limit < k){
            
            if(N[ntop] > M[mtop] || mtop >= m){
                if((limit + M[mtop]) < k) limit += M[mtop++];
                else break;
            }else{
                if((limit + N[ntop]) < k) limit += N[ntop++];
                else break;
            }

        }

        System.out.println(mtop+ntop);

    }
}

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

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

int main(){
    long long int N, M, K;
    cin >> N >> M >> K;
    vector<int> A(N);
    for (int i=0; i<N; i++){
        cin >> A[i];
    }
    vector<int> B(M);
    for (int j=0; j<M; j++){
        cin >> B[j];
    }

    long long int weightA = 0;
    int a, tmp_A=N;
    for (int i=0; i<N; i++){
        a = A[i];
        if (weightA + a > K){
            tmp_A = i;
            break;
        }else{
            weightA += a;
        }
    }

    long long int max_count, current_count, len_A;
    max_count = tmp_A;
    current_count = tmp_A;
    len_A = tmp_A;

    long long int weightB = 0;
    bool terminated = false;
    long long int b;
    for (int j=0; j<M; j++){
        b = B[j];
        if (terminated == false && weightA + weightB > K){
            break;
        }

        if (len_A == 0 && weightA + weightB + b > K){
            break;
        }

        if (weightA + weightB + b <= K){
            weightB += b;
            current_count++;
        }

        else if (terminated == false){
            while (weightA + weightB + b > K){
                if (len_A > 0){
                    weightA -= A[len_A-1];
                    len_A--;
                    current_count--;
                }else{
                    terminated = true;
                }
            }
            if (weightA + weightB + b <= K){
                weightB += b;
                current_count++;
            }
        }
        max_count = max(max_count, current_count);
    }
    cout << max_count << endl;
}

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

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

int main()
{
    int n, m;
    int k;
    vector <int> a(n), b(m);
    int ans = 0;

    cin >> n >> m >> k;
    vectorin(a);
    vectorin(b);

    int time=0;
    for (int num = 0; num <= m; num++) {
        int karians = 0;
        for (int i = 0; num != 0 && time <= k; i++) {
            time += b[i];
            num--;

            karians += 1;
        }
        for (int i = 0; time <= k; i++) {
            time += a[i];

            karians += i;
        }

        if (ans < karians) {
            ans = karians;
        }
    }

    cout << ans;
}

void vectorin(vector <int>& vec) {
    for (int i = 0; i < vec.size(); i++) {
        cin >> vec[i];
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'vectorin' was not declared in this scope
   13 |     vectorin(a);
      |     ^~~~~~~~
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int ans = 0;
		int N = scan.nextInt();
		int M = scan.nextInt();
		int K = scan.nextInt();
		int[] A = new int[N + 1];
		int[] B = new int[M + 1];
		int Acount = 0;
		int Bcount = 0;

		for(int i = 0;i < N;i++) {
			A[i] = scan.nextInt();
		}

		for(int i = 0;i < M;i++) {
			B[i] = scan.nextInt();
		}

		A[N] = 1000000001;
		B[M] = 1000000001;

		while(true) {
			if(A[Acount] > B[Bcount]) {
				K -= B[Bcount];
				Bcount++;
			}else {
				K -= A[Acount];
				Acount++;
			}

			if(K < 0 || (Acout == N && Bcount == M)) {
				break;
			}

			ans++;
		}

		System.out.println(ans);

	}
}

Compiler output:
Main.java:36: error: cannot find symbol
			if(K < 0 || (Acout == N && Bcount == M)) {
			             ^
  symbol:   variable Acout
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define LOOP(i, N) for (int i = 1; i <= (int)N; i++)
#define RREP(i, N) for (int i =(int)N-1; i >= 0; i--)
#define RLOOP(i, N) for (int i =(int)N; i > 0; i--)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define pb push_back

typedef long long ll;

typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
//cout<<"Yes"<<endl;
//cout<<"No"<<endl;

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll n,m,k;
ll ans=0;
vector <ll> a;
vector <ll> b;
int dfs(int i,int ai,int bi,ll sum){
    if(sum>k)return i;
    ll tmp;
    if(sum+a[ai]<=k&&ai<n){
      tmp=dfs(i+1,ai+1,bi,sum+a[ai]);
        c.pb(tmp);
        if(tmp>ans)ans=tmp;
    }
    if(sum+b[bi]<=k&&bi<m){
      tmp=dfs(i+1,ai,bi+1,sum+b[bi]);
        if(tmp>ans)ans=tmp;
    }
    return i;
}
    
int main(){
    cin>>n>>m>>k;
    REP(i,n){
        int tmp;
        cin>>tmp;
        a.pb(tmp);
    }
    REP(i,m){
        int tmp;
        cin>>tmp;
        b.pb(tmp);
    }
    a.pb(INF);
    b.pb(INF);
    ll i=dfs(0,0,0,0);
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int dfs(int, int, int, ll)':
a.cc:33:9: error: 'c' was not declared in this scope
   33 |         c.pb(tmp);
      |         ^
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int K = sc.nextInt();
		List<Integer> A = new ArrayList<>();
		List<Integer> B = new ArrayList<>();
		for(int i = 0; i < M; i++){
			A.add(sc.nextInt());
		}
		for(int i = 0; i < N; i++){
			B.add(sc.nextInt());
		}
		A.add(1000000001);
		B.add(1000000001);
		int indexA = 0;
		int indexB = 0;
		int time = 0;
		int count = 0;
		while(true){
			if(A.get(indexA) <= B.get(indexB)){
				if(A.get(indexA) + time <= K){
					time += A.get(indexA);
					indexA++;
				}else{
					break;
				}
			}else if(A.get(indexA) => B.get(indexB)){
				if(B.get(indexB) + time <= K){
					time += B.get(indexB);
					indexB++;
				}else{
					break;
				}
			}else if(A.get(indexA) == 1000000001 && B.get(indexB) == 1000000001){
				break;
			}
			count++;
		}
		System.out.print(count);
	}
}

Compiler output:
Main.java:31: error: illegal start of expression
			}else if(A.get(indexA) => B.get(indexB)){
			                        ^
1 error
Language: C++

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

int main()
{
    int n, m;
    int k;
    vector <int> a(n), b(m);
    int ans = 0;

    cin >> n >> m >> k;
    vectorin(a);
    vectorin(b);

    int time=0;
    for (int num = 0; num <= m; num++) {
        int karians = 0;
        for (int i = 0; num != 0 && time <= k; i++) {
            time += b[i];
            num--;

            karians += 1;
        }
        for (int i = 0; time <= k; i++) {
            time += a[i];

            karians += i;
        }

        if (ans < karians) {
            ans = karians;
        }
    }

    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'vectorin' was not declared in this scope
   13 |     vectorin(a);
      |     ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
 int n,m,k;
 cin>>n>>m>>k;
 vector<int>a(n);
 vector<int>b(m);
 for(int i=0;i<n;i++)	cin>>a[i];
 for(int i=0;i<m;i++)	cin>>b[i];
 ll cnt =0,sum=0;
 int i=0,j=0;
 while(i<n && j<m&& sum+min(a[i],b[j])<=k)
 {
	if(sum + a[i] <=sum + b[j])
	sum+=a[i++];
	else
	sum+=b[j++];
 }
 if(i==n && j<m)
 {
 	while( j<m && sum+b[j]<=k)
 	{
 		sum+=b[j++];
 		cnt++;
	 }
 }
 if(j==m && i<n)
 {
 	while(i<n&&sum+a[i]<=k)
 	{
 		sum+=a[i++];
 		cnt++;
	 }
 }
 cout<<cnt;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:2: error: 'll' was not declared in this scope
   11 |  ll cnt =0,sum=0;
      |  ^~
a.cc:13:21: error: 'sum' was not declared in this scope
   13 |  while(i<n && j<m&& sum+min(a[i],b[j])<=k)
      |                     ^~~
a.cc:22:23: error: 'sum' was not declared in this scope
   22 |         while( j<m && sum+b[j]<=k)
      |                       ^~~
a.cc:25:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   25 |                 cnt++;
      |                 ^~~
      |                 int
a.cc:30:20: error: 'sum' was not declared in this scope
   30 |         while(i<n&&sum+a[i]<=k)
      |                    ^~~
a.cc:33:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   33 |                 cnt++;
      |                 ^~~
      |                 int
a.cc:36:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
   36 |  cout<<cnt;
      |        ^~~
      |        int
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
    long long N, M, K;
    cin >> N >> M >> K;

    queue<long long> A;
    queue<long long> B;
    int a,b;
    for(int i = 0 ;i < N;i++){
        cin >> a;
        A.push(a);
    }
     for(int i = 0 ;i < M;i++){
        cin >> b;
        B.push(b);
    }

    long long t = 0;
    int result = 0;
    while(1) {
        if(A.empty() == true && B.empty() == true){
            break;
        }
        else if(A.empty() != true && B.empty() != true) {
            if(t + A.front() > K && t + B.front() > K) {
                break;
            }  
            else {
                if(A.front() > B.front()) {
                    t += B.front();
                    B.pop();
                    result++;
                }
                else if (A.front() == B.front())
                else {
                    t += A.front();
                    A.pop();
                    result++;
                }
            } 
        }
        else if(A.empty() != true && B.empty() == true) {
            if(t + A.front() <= K) {
                t += A.front();
                A.pop();
                result++;
            }
            else {
                break;
            }
        }
        else if(A.empty() == true && B.empty() != true) {
            if( t + B.front() <= K) {
                t += B.front();
                B.pop();
                result++;
            }
            else {
                break;
            }
        }
        else {
            cout << "error" << endl;
        }

    }
    cout << result << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: expected primary-expression before 'else'
   39 |                 else {
      |                 ^~~~