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

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

int n,x,ans;
int l[100],lichi[101];


void solve() {

}

int main()
{
    cin >> n >> x;

    l[0]=0;
    ans = 1;
    for (int i=0;i<n;++i) {
      cin >> l[i];
      lichi[i+1] = l[i]+l[i-1]
      if (lchi[i+1]<=x) {
        ans++;
      }
    }

      solve();

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: expected ';' before 'if'
   20 |       lichi[i+1] = l[i]+l[i-1]
      |                               ^
      |                               ;
   21 |       if (lchi[i+1]<=x) {
      |       ~~
Language: C++

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCorder_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(y => int.Parse(y));
            var x = input.Skip(1).First();
            var l = Console.ReadLine().Split(' ').Select(y => int.Parse(y)).ToArray();

            var ans = Enumerable.Repeat(l, l.Length)
                .Select((y, i) => y.Take(i))
                .TakeWhile((y, i) => y.Sum() <= x)
                .Count();
            Console.WriteLine(ans);
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Linq;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Text;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:12:26: error: 'string' has not been declared
   12 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:12:35: error: expected ',' or '...' before 'args'
   12 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:24:6: error: expected ';' after class definition
   24 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void AtCorder_B::Program::Main(int*)':
a.cc:14:13: error: 'var' was not declared in this scope
   14 |             var input = Console.ReadLine().Split(' ').Select(y => int.Parse(y));
      |             ^~~
a.cc:15:17: error: expected ';' before 'x'
   15 |             var x = input.Skip(1).First();
      |                 ^
a.cc:16:17: error: expected ';' before 'l'
   16 |             var l = Console.ReadLine().Split(' ').Select(y => int.Parse(y)).ToArray();
      |                 ^
a.cc:18:17: error: expected ';' before 'ans'
   18 |             var ans = Enumerable.Repeat(l, l.Length)
      |                 ^~~
a.cc:22:13: error: 'Console' was not declared in this scope
   22 |             Console.WriteLine(ans);
      |             ^~~~~~~
a.cc:22:31: error: 'ans' was not declared in this scope
   22 |             Console.WriteLine(ans);
      |                               ^~~
Language: C++

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

int main(){
  int n,x,i;
  cin>>n>>x;
  vector<int> l = (n,0);
  for(i=0;i<n;i++)
    cin>>l[i];
  int count = 0;
  if(0<=x){
    count++;
  }
  int temp= 0;
  for(i=0;i<=n;i++){
    temp = temp + l[i];
    if(temp<x)
      count++;
  }
  cout<<count<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: conversion from 'int' to non-scalar type 'std::vector<int>' requested
    8 |   vector<int> l = (n,0);
      |                      ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;

int main(){
    int N,X;
    scanf("%d %d",&N,&X);
    int L[N];
    for(int i=0;i<N;i++) scanf("%d",&L[i]);
    int za=0;
    i=1;
    int cnt = 0;
    while(za < X){
        cnt++;
        za = za + L[i-1];
    }
    printf("%d\n",cnt);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'i' was not declared in this scope
   16 |     i=1;
      |     ^
Language: C

#include <iostream>
#include <stdio.h>
using namespace std;
int main(void){
    // Your code here!
    int x,n,l[105],d[10005],o=1,ans=0;
    
    scanf("%d%d",&n,&x);
    
    for(int i=1;i<=n;i++){
        scanf("%d",&l[i]);
    }
    
    d[1]=0;
    
    for(int i=2;i<=n+1;i++){
        d[i]=d[i-1]+l[i-1];
    }
    
    while(d[o]<=x){
        o++;
        ans++;
    }
    
    printf("%d",ans);
    return 0;
}

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

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;

int main(){
    int N,X;
    scanf("%d %d",N,X);
    int L[N];
    for(int i=0;i<N;i++) scanf("%d",&L[i]);
    int za=0;
    i=1;
    int cnt = 0;
    while(za < X){
        cnt++;
        za = za + L[i-1];
    }
    printf("%d\n",cnt);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'i' was not declared in this scope
   16 |     i=1;
      |     ^
Language: C++

#include <stdio.h>

int main() {
	
	int N = 0, X = 0;
	scanf("%d %d",&N,&X);
	
	int L[N];
	int i = 0;
	for( i = 0 ; i < N ; i++ ){
		scanf("%d",&L[i]);
	}
	
	res = 0, count = 0;
	do{
		count++;
		res = res + L[count];
	} while (res<=X);
	
	printf("%d",count);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'res' was not declared in this scope
   14 |         res = 0, count = 0;
      |         ^~~
a.cc:14:18: error: 'count' was not declared in this scope
   14 |         res = 0, count = 0;
      |                  ^~~~~
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	int x = sc.nextInt();
      	List<Integer> list = new ArrayList<>();
      
      	int count = 1, d = 0;
      	for(int i = 0; i < n; i++){
        	list.add(sc.nextInt());
        } 
      	
      	int temp
      	for(int i = 1; i <= n+1; i++){
           	temp = d;
        	d = temp + list.get(i-1);
          	if(d <= x){
            	count++;
            }else{
            	break;
            }
        }
      
      	System.out.println(count);
    }
}

Compiler output:
Main.java:15: error: ';' expected
      	int temp
      	        ^
1 error
Language: C++

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

int main(){
  int N,X;
  cin >> N >> X;
  int D[N+1];
  D[0]=0;
  int ans=1;
  rep(1,N){
    int L;
    cin >> L;
    D[i+1]=D[i]+L;
    if(D[i+1]<=X) ans++;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: expected unqualified-id before numeric constant
   12 |   rep(1,N){
      |       ^
a.cc:2:26: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:12:7: error: expected ';' before numeric constant
   12 |   rep(1,N){
      |       ^
a.cc:2:26: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:12:7: error: lvalue required as left operand of assignment
   12 |   rep(1,N){
      |       ^
a.cc:2:26: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:2:33: error: expected ')' before ';' token
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                     ~           ^
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(1,N){
      |   ^~~
a.cc:12:7: error: lvalue required as increment operand
   12 |   rep(1,N){
      |       ^
a.cc:2:34: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,x;
  cin>>N>>x;
  
  vector<int> vec(N);
for (int i = 0; i < N; i++) {
  cin >> vec.at(i);

  int d=0; int k=1;
  for(int i=0; i<N; i++){
    d=d+vec.at(i);
    if(d<=x){
      k++;}
    else{break;}
  }
  
  cout<<k<<endl;
}
    


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

#include <iostream>
#include <vector>
int main(int argc, char**argv){
  
  int n_num,x_num;
  std::cin>>n_num>>x_num;
  std::vector<int> l_num;
  l_num.resize(n_num);
  
  for(size_t i = 0 ; i < l_num.size() ; i++){
    std::cin>>l_num[i]
  }
  int bcount=0,pos=0;
  for(int i = 0 ; i < n_num ; i++){
    pos += l_num[i];
    if(pos<=x_num){
      bcount++;
    }
  }
  if(0<x_num){
    bcount++;
  }
  std::cout<<bcount<<std::endl;
 
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:11:23: error: expected ';' before '}' token
   11 |     std::cin>>l_num[i]
      |                       ^
      |                       ;
   12 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,x;
  cin>>n>>x;
  
  vector<int> vec(N);
for (int i = 0; i < N; i++) {
  cin >> vec.at(i);

  int d=0; int k=1;
  for(int i=0; i<N; i++){
    d=d+vec.at(i);
    if(d<=x){
      k++;}
    else{break;}
  }
  
  cout<<k<<endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: 'n' was not declared in this scope
    6 |   cin>>n>>x;
      |        ^
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main(){
  int n,x,i;
  cin>>n>>x;
  vector<int> l = (n,0);
  for(i=0;i<n;i++)
    cin>>l[i];
  int count = 0;
  if(0<=x){
    count++;
  }
  int temp;
  int di = 0;
  for(i=0;i<=n;i++){
    temp = temp + l[i];
    if(temp<x)
      count++;
  }
  cout<<count<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: conversion from 'int' to non-scalar type 'std::vector<int>' requested
    8 |   vector<int> l = (n,0);
      |                      ^
Language: C++

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

int main () {
  int n, x;
  cin >> n >> x;
  
  vector<int> l;
  for (int i=0; i<n; i++) {
    cin >> l.at(i);
  }
  
  int bound = 0;
  int j = 0;
  for (bound < x + 1) {
    bound += l.at(j);
    j++;
  }
  
  cout << j << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before ')' token
   15 |   for (bound < x + 1) {
      |                     ^
      |                     ;
a.cc:21:1: error: expected primary-expression before '}' token
   21 | }
      | ^
a.cc:20:21: error: expected ')' before '}' token
   20 |   cout << j << endl;
      |                     ^
      |                     )
   21 | }
      | ~                    
a.cc:15:7: note: to match this '('
   15 |   for (bound < x + 1) {
      |       ^
a.cc:21:1: error: expected primary-expression before '}' token
   21 | }
      | ^
Language: C++

include <iostream>
#define rep(i, start, end) for (int i = start; i < end; i++)
using namespace std;

int main(){
  int n, x;
  cin >> n >> x;
  int d[n+1];
  d[0] = 0;
  int a;
  int cnt = 1;
  rep(i, 1, n+1) {
    cin >> a;
    d[i] = d[i-1] + a;
    if (d[i] <= x){
      cnt++;
    }
  }

  cout << cnt << endl;
  return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> n >> x;
      |   ^~~
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout << cnt << endl;
      |   ^~~~
a.cc:20:18: error: 'endl' was not declared in this scope
   20 |   cout << cnt << endl;
      |                  ^~~~
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int[] L = new int[n+1];
		int step = 0;
		int pos = 0;
		
		for (int i = 0; i < n; i++) {
			L[i] = sc.nextInt();
		}
		
		for (int i = 0; i < n; i++) {
			if (pos > x) {
				break;
			}
			pos += L[i];
			step++;
		}
		
		System.out.println(step);

	}
}

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

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

int main(){
  int n,m,i,sum=0,a
  cin<<n<<m;
  for(i=1;i<=n;i++){
	cin<<a;
	if(a<=m) sum++;
  }
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin<<n<<m;
      |   ^~~
a.cc:8:14: error: 'a' was not declared in this scope
    8 |         cin<<a;
      |              ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n,x,i;
  cin>>n>>x;
  vector<int> l = (n,0);
  for(i=0;i<n;i++)
    cin>>l[i];
  int count = 0;
  if(0<=x){
    count++;
  }
  int temp;
  int di = 0;
  for(i=0;i<=n;i++){
    temp = temp + l[i];
    if(temp<x)
      count++;
  }
  cout<<count<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> l = (n,0);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> l = (n,0);
      |          ^~~
a.cc:9:10: error: 'l' was not declared in this scope
    9 |     cin>>l[i];
      |          ^
a.cc:17:19: error: 'l' was not declared in this scope
   17 |     temp = temp + l[i];
      |                   ^
Language: C++

#include <iostream>
using namespace std ;

void main(void)
{
    int n, x ;
    
    cin >> n >> x ;
    vector<int> l ;
    for (int i = 0; i < n; i++)
        cin >> l[i] ;
    
    int total = 0 ;
    for (int i = 0; i < n; i++) {
        total += l[i] ;
        if (total > x) {
            cout << i+1 << endl ;
            break ;
        }
    }
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main(void)
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> l ;
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std ;
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> l ;
      |            ^~~
a.cc:11:16: error: 'l' was not declared in this scope
   11 |         cin >> l[i] ;
      |                ^
a.cc:15:18: error: 'l' was not declared in this scope
   15 |         total += l[i] ;
      |                  ^
Language: C++

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

int main(){
  int n,m,i,sum=0,a
  cin<<n<<m;
  for(i=1;i<=n;i++){
	cin>>a;
	if(a<=m) sum++;
  }
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin<<n<<m;
      |   ^~~
a.cc:8:14: error: 'a' was not declared in this scope
    8 |         cin>>a;
      |              ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n,x,i;
  cin>>n>>x;
  vector<int> l = (n,0);
  for(i=0;i<n;i++)
    cin>>l[i];
  int count = 0;
  if(0<=x){
    count++;
  }
  int temp;
  int di = 0;
  for(i=0;i<=n;i++){
    temp = temp + li[i];
    if(temp<x)
      count++;
  }
  cout<<count<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> l = (n,0);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> l = (n,0);
      |          ^~~
a.cc:9:10: error: 'l' was not declared in this scope
    9 |     cin>>l[i];
      |          ^
a.cc:17:19: error: 'li' was not declared in this scope; did you mean 'di'?
   17 |     temp = temp + li[i];
      |                   ^~
      |                   di
Language: C++

int main()
{
        int N, X;
        cin >> N >> X;
        vector<int> L(101);
        for(int i = 0; i < N; i++) cin >> L[i];

        int d = 0;
        d += L[0];
        if(d > X) cout << '1' << endl;
        for(int i = 2; i < N; i++)
        {
                d = d + L[i-1];
                if(d > X)
                {
                        cout << i << endl;
                        return 0;
                }
        }
        cout << N << endl;

        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> N >> X;
      |         ^~~
a.cc:5:9: error: 'vector' was not declared in this scope
    5 |         vector<int> L(101);
      |         ^~~~~~
a.cc:5:16: error: expected primary-expression before 'int'
    5 |         vector<int> L(101);
      |                ^~~
a.cc:6:43: error: 'L' was not declared in this scope
    6 |         for(int i = 0; i < N; i++) cin >> L[i];
      |                                           ^
a.cc:9:14: error: 'L' was not declared in this scope
    9 |         d += L[0];
      |              ^
a.cc:10:19: error: 'cout' was not declared in this scope
   10 |         if(d > X) cout << '1' << endl;
      |                   ^~~~
a.cc:10:34: error: 'endl' was not declared in this scope
   10 |         if(d > X) cout << '1' << endl;
      |                                  ^~~~
a.cc:16:25: error: 'cout' was not declared in this scope
   16 |                         cout << i << endl;
      |                         ^~~~
a.cc:16:38: error: 'endl' was not declared in this scope
   16 |                         cout << i << endl;
      |                                      ^~~~
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << N << endl;
      |         ^~~~
a.cc:20:22: error: 'endl' was not declared in this scope
   20 |         cout << N << endl;
      |                      ^~~~
Language: C

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

int main(){
int N,X,L=0,a=1;
  scanf("%d %d",&N,&X);
  int *D=(int*)malloc(sizeof(int)*N);
  for(i=0;i<N;i++){
  	scanf("%d",&D[i]);
    L+=D[i];
    if(L<=X)a++;
    else break;
  }
  printf("%d\n",a);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:7: error: 'i' undeclared (first use in this function)
    8 |   for(i=0;i<N;i++){
      |       ^
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
  int n, x;
  cin >> n >> x;
  
  int d = 0, l[n+1], i;
  for(i=1;d<=x || i<=n;i++) {
    cin >> l[i];
    d = d + l[i];
  }
  cout << i-1 << endl;
}


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


import javafx.scene.transform.Scale;

import java.util.Scanner;

/**
 * @program: leetcode
 * @description:
 * @author: wangtengke
 * @create: 2019-06-16
 **/
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int[] L = new int[n];
        for(int i=0; i<n; i++){
            L[i] = scanner.nextInt();
        }
        int res = solve(L, n, x);
        System.out.println(res);
    }

    private static int solve(int[] l, int n, int x) {
        int count = 0;
        int sum = 0;
        for (int i = 0; i < n; i++) {
            sum += l[i];
            count++;
            if(sum>x) break;
        }
        return count;
    }

}


Compiler output:
Main.java:2: error: package javafx.scene.transform does not exist
import javafx.scene.transform.Scale;
                             ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,x,a[104],t=0;
	cin>>n>>x;
	for(int i=0;i<n;i++)
	cin>>a[i];
	for(int i=0;;i++)
	{
		t+=a[i];
		if(a[i]>x)
		break;
	}
	cout<<i;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'i' was not declared in this scope
   15 |         cout<<i;
      |               ^
Language: C++

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
  int64 N, K;
  cin >> N >> K;
  vector<int64> a(N);
  REP(i, N) cin >> a[i];
  int64 sum = 0, r = 0;
  int64 res = 0;
  REP(i, N) {
    if (i > 0) sum -= a[i-1];
    while (sum < K && r < a.size()) sum += a[r++];
    if (sum >= K)
      res += N-r+1;
  }
  cout << res << endl;
}

int main(void) {
  int64 N, X;
  cin >> N >> X;
  int64 D = 0, cnt = 1;
  REP(i, N) {
    int64 L;
    cin >> L;
    D += L;
    cnt += D <= X;
  }
  cout << cnt << endl;
}

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

import java.util.Scanner;

public class Main {
    public static void main(String... args) {
        // 入力
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] l = new int[n];
        for (int i=0;i<n;i++) {
            l[i] = sc.nextInt();
        }

        int result =  1;
        int sum = 0;
        for (int i=0;i<n;i++) {
            sum += l[i];
            if (sum > x) break;
            result++;
        }

        System.out.println(result);
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include<iostream>

using namespace std;
int main(){
  int N=0;
  int X=0;
  int L[100]={0};
  int ans=0;
  s=0;
  cin>>N>>X;
  for(i=0;i<N;i++){
    cin>>L[i];
    s+=L[i];
    if(s=<X){
      ans++;
    }
  }
  cout<<ans+1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 's' was not declared in this scope
    9 |   s=0;
      |   ^
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N;i++){
      |       ^
a.cc:14:10: error: expected primary-expression before '<' token
   14 |     if(s=<X){
      |          ^
Language: C++

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

using ll=long long;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

int div1(ll x){
  return x%1000000007;
}

main(){
    int n=in(),x=in(),l[n],m=0;
    forin(l,n);
    for (int i=0;i<n;i++){
        m+=l[n];
        if (m>x) break;
    }
    cout << i << endl;
}


Compiler output:
a.cc:49:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   49 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:56:13: error: 'i' was not declared in this scope
   56 |     cout << i << endl;
      |             ^
Language: C++

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
using namespace std;
using ll=long long;
const ll MOD=1000003;
const ll LINF=0x1fffffffffffffff;
const int INF=0x3fffffff;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=b-1;i>=a;i--)
#define range(i) (i).begin(),(i).end()
#define rrange(i) (i).rbegin(),(i).rend()
inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans%MOD*(b&1?a:1)%MOD;
}
inline constexpr int modf(ll n){
    ll ans=1;
    rep(i,0,n) {ans=ans*(n-i)%MOD;}
    return ans;
}
inline long double median(vector<ll> v){
    ll size=v.size();
    sort(v.begin(),v.end());
    if (size % 2 == 1) return v[(size - 1) / 2];
    else return v[(size / 2) - 1] ;
}
template<class T> inline bool chmax(T& a,T b) {if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b) {if(a>b){a=b;return 1;} return 0;}
template<class T,class L>ostream& operator << (ostream& os, pair<T,L>& p){os << p.first << " " << p.second;return os;}

int main(){
  ll n,x;
  cin>>n>>x;
  ll d=0;
  vector<ll> l(n);
  rep(i,0,n) cin>>l[i];
  ll cnt=1;
  while(d<x&&cnt<n+2){
    d+=l[i];
    cnt++;
  }
  cout<<cnt;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:10: error: 'i' was not declared in this scope
   49 |     d+=l[i];
      |          ^
Language: C++

N, X = map(int, input().split())
L = list(map(int, input().split()))

cnt = 1
D = 0
for i in range(1, N):
    D = D + L[i-1]
    if D <= X:
        cnt += 1
    else:
        break
print(cnt)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, X = map(int, input().split())
      | ^
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int[] l = new int[n];
    for(int i=0; i<n; i++){
      l[i] = sc.nextInt();
    }
    int d = 0;
    
    for(int i=1; i<=n; i++){
      d = d+l[i-1];
      if(d>x) break;
    }
    System.out.println(i-1);
  }
}

Compiler output:
Main.java:18: error: cannot find symbol
    System.out.println(i-1);
                       ^
  symbol:   variable i
  location: class Main
1 error
Language: Java

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author dyominov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BBounding solver = new BBounding();
        solver.solve(1, in, out);
        out.close();
    }

    static class BBounding {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int x = in.nextInt();
            int[] l = new int[n + 1];
            for (int i = 0; i < n; i++) {
                l[i] = in.nextInt();
            }
            int[] d = new int[n + 1];
            for (int i = 1; i <= n; i++) {
                d[i] = d[i - 1] + l[i - 1];
            }
            int count = 0;
            for (int i = 0; i <= n; i++) {
                if (d[i] <= x) {
                    count++;
                }
            }
            out.println(count);
        }

    }

    static class InputReader implements AutoCloseable {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }


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

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

int main(){
  int N;
  cin >> N >> X;
  int D[N+1];
  D[0]=0;
  int ans=1;
  rep(1,N){
    int L;
    cin >> L;
    D[i+1]=D[i]+L;
    if(D[i+1]<=X) ans++;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'X' was not declared in this scope
    8 |   cin >> N >> X;
      |               ^
a.cc:12:7: error: expected unqualified-id before numeric constant
   12 |   rep(1,N){
      |       ^
a.cc:2:26: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:12:7: error: expected ';' before numeric constant
   12 |   rep(1,N){
      |       ^
a.cc:2:26: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:12:7: error: lvalue required as left operand of assignment
   12 |   rep(1,N){
      |       ^
a.cc:2:26: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:2:33: error: expected ')' before ';' token
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                     ~           ^
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(1,N){
      |   ^~~
a.cc:12:7: error: lvalue required as increment operand
   12 |   rep(1,N){
      |       ^
a.cc:2:34: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                  ^
Language: C++

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

int main(){
  int n,x;
  cin >> n >> x;
  int d = 0;
  int c = 1;
  for (int i=0;i<n;i++){
    int l;
    cin >> l;
    d = d + l;
    if (d <= x){
      cnt++;
    }else{
      break;
    }
  }
  cout << cnt << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   15 |       cnt++;
      |       ^~~
      |       int
a.cc:20:11: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |   cout << cnt << endl;
      |           ^~~
      |           int
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  LL W, H, x, y, b=0;
  cin >> W >> H >> x >> y;
  double s;
  s = W * H /2.0;
  
  if (W == x*2 && H == y*2 ) {
    b++;
  }
  
  cout << s << " " << b << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'LL' was not declared in this scope
    5 |   LL W, H, x, y, b=0;
      |   ^~
a.cc:6:10: error: 'W' was not declared in this scope
    6 |   cin >> W >> H >> x >> y;
      |          ^
a.cc:6:15: error: 'H' was not declared in this scope
    6 |   cin >> W >> H >> x >> y;
      |               ^
a.cc:6:20: error: 'x' was not declared in this scope
    6 |   cin >> W >> H >> x >> y;
      |                    ^
a.cc:6:25: error: 'y' was not declared in this scope; did you mean 'yn'?
    6 |   cin >> W >> H >> x >> y;
      |                         ^
      |                         yn
a.cc:11:5: error: 'b' was not declared in this scope
   11 |     b++;
      |     ^
a.cc:14:23: error: 'b' was not declared in this scope
   14 |   cout << s << " " << b << endl;
      |                       ^
Language: C++

int main() {
    double W,H,x,y;
    cin >> W >> H >> x >> y;
    printf("%.6f ", W*H/2);
    if(W/2==x&&H/2==y){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> W >> H >> x >> y;
      |     ^~~
a.cc:4:5: error: 'printf' was not declared in this scope
    4 |     printf("%.6f ", W*H/2);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main() {
a.cc:6:9: error: 'cout' was not declared in this scope
    6 |         cout << 1 << endl;
      |         ^~~~
a.cc:6:22: error: 'endl' was not declared in this scope
    6 |         cout << 1 << endl;
      |                      ^~~~
a.cc:8:9: error: 'cout' was not declared in this scope
    8 |         cout << 0 << endl;
      |         ^~~~
a.cc:8:22: error: 'endl' was not declared in this scope
    8 |         cout << 0 << endl;
      |                      ^~~~
Language: C++

#include<bits/stdc++.h> 
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define int long long
#define swap(x,y) (x^=y^=x^=y)

#define debug1(a) cerr<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cerr<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;
#define debug3(a,b,c) cerr<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;
#define debug4(a,b,c,d) cerr<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl;

using namespace std;
 
#define mod 1000000007
long long modexpo(long long x, long long p){
    int res = 1;x = x%mod;
    while(p){
        if(p%2)res = res * x;
        p >>= 1;
        x = x*x % mod;
        res %= mod;
    }
    return res;
}

struct compare{
    bool operator() (const pair<int,int> a, const pair<int,int> b) const{
        return a.first < b.first;
    }
};

int32_t main(){
    IOS
    double w,h,x,y;
    cin >> w >> h >> x >> y;
    double a = min(x*h, (w-x)*h);
    double b = min(y*w, (h-y)*w);
    int x = 0;
    if(a == b){
        x = 1;
    }
    cout << fixed << setprecision(10) <<  max(a,b) << " " << x << endl;
} 

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:38:9: error: conflicting declaration 'long long int x'
   38 |     int x = 0;
      |         ^
a.cc:34:16: note: previous declaration as 'double x'
   34 |     double w,h,x,y;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  long double H,W,h,w; cin>>H,W,h,w;
  cout<<fixed<<setpresicion(10)<<H*W/2.0<<" "<<(H/2==h&&W/2==w? 1:0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: 'setpresicion' was not declared in this scope
    5 |   cout<<fixed<<setpresicion(10)<<H*W/2.0<<" "<<(H/2==h&&W/2==w? 1:0)<<endl;
      |                ^~~~~~~~~~~~
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long w = sc.nextLong();
    long h = sc.nextLong();
    long x = sc.nextLong();
    long y = sc.nextLong();
    
    double area = (w*h)/2;
    inta ju = 0;
    
    if(w == 2*x && h == 2*y) ju = 1;

    System.out.println(area + " " + ju);
    
  }
}

Compiler output:
Main.java:11: error: cannot find symbol
    inta ju = 0;
    ^
  symbol:   class inta
  location: class Main
1 error
Language: C

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
string solve(bool a) { return ((a) ? "Yes" : "No"); }
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
template <class T, class U>ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}
template <class T>ostream& operator<<(ostream& os, const vector<T>& v) {
	os << "{";
	rep(i, v.size()) {
		if (i) os << ",";
		os << v[i];
	}
	os << "}";
	return os;
}
template <class T, class U>istream& operator>>(istream& is, pair<T, U>& p) {
	is >> p.first >>p.second ;
	return is;
}
template <class T>istream& operator>>(istream& is,  vector<T>& v) {
	rep(i, v.size()) {
		is >> v[i];
	}
	return is;
}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int h,w,x,y;
	double ans = 0.0;
	cin >>h>>w>>x>>y;
	ans = (double)h * w / 2.0;
	printf("%.9lf\n", ans);
	cout << (((double)y * 2.0 == (double)w) and ((double) x * 2.0 == (double)h))
	     << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int W,H,X,Y;
  cin>>W>>H>>X>>Y;
  scanf("%d%d%d%d", &a, &b, &x, &y);
  printf("%lf %d\n", double(a)*double(b) / 2, x + x == a&&y + y == b);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: 'a' was not declared in this scope
    6 |   scanf("%d%d%d%d", &a, &b, &x, &y);
      |                      ^
a.cc:6:26: error: 'b' was not declared in this scope
    6 |   scanf("%d%d%d%d", &a, &b, &x, &y);
      |                          ^
a.cc:6:30: error: 'x' was not declared in this scope
    6 |   scanf("%d%d%d%d", &a, &b, &x, &y);
      |                              ^
a.cc:6:34: error: 'y' was not declared in this scope
    6 |   scanf("%d%d%d%d", &a, &b, &x, &y);
      |                                  ^
Language: C++

#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX;
#define INFL LLONG_MAX;
typedef long long ll;
using namespace std;
int main(){

int x,y,way;
double W,H,sum;
scanf("%lf%lf%d%d",&W,&H,&x,&y);



if(x*2==W && y*2==H){
  way=1;
}

else{
way=0;
}

sum=W*H/2

printf("%f %d\n",sum,way);

}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: expected ';' before 'printf'
   26 | sum=W*H/2
      |          ^
      |          ;
   27 | 
   28 | printf("%f %d\n",sum,way);
      | ~~~~~~
Language: C++


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

 int main(void){

  long long w,h,x,y;
  cin>>w>>h>>x>>y;

  printf("%.08LF ",(long double)w*h/2.0);

  if(2*x == w && 2*y == h)
    printf("1\n);
    else
    printf("0\n");


 return 0;
 }


Compiler output:
a.cc:15:12: warning: missing terminating " character
   15 |     printf("1\n);
      |            ^
a.cc:15:12: error: missing terminating " character
   15 |     printf("1\n);
      |            ^~~~~~
a.cc: In function 'int main()':
a.cc:16:5: error: expected primary-expression before 'else'
   16 |     else
      |     ^~~~
Language: C++


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

 int main(void){

  long long w,h,x,y;
  cin>>w>>h>>x>>y;

  printf("%.08LF ",(long double)w*h/2.0);

  if(2*x == w && 2*y == h)
    printf("1\n")
    else
    printf("0\n");


 return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected ';' before 'else'
   15 |     printf("1\n")
      |                  ^
      |                  ;
   16 |     else
      |     ~~~~
Language: C++

# include <bits/stdc++.h>
# define rep(i, n) for(ll i = 0; i < (n); ++i)
# define reps(i, n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(ll i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(ll i=((int)(n)); i>0; --i)
# define ll long long
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define P pair<int, int>
# define mp make_pair
# define x first
# define y second
using namespace std;
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 (b<a) { a=b; return 1; } return 0; }

int main() {
  double w, h, x, y; cin >> w >> h >> x >> y;

  double ans = w / 2;
  ans *= h;
  int subans = 0;
  if(w % 2 == 0 && w / 2 == x && h % 2 == 0 && h / 2 == y) subans = 1;

  cout << ans << endl;
  cout << subans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:8: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   25 |   if(w % 2 == 0 && w / 2 == x && h % 2 == 0 && h / 2 == y) subans = 1;
      |      ~ ^ ~
      |      |   |
      |      |   int
      |      double
a.cc:25:36: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   25 |   if(w % 2 == 0 && w / 2 == x && h % 2 == 0 && h / 2 == y) subans = 1;
      |                                  ~ ^ ~
      |                                  |   |
      |                                  |   int
      |                                  double
Language: C++

#include<iostream>
#include<string>
#include<stdio.h>
#include <algorithm>
#include <set>
#include<math.h>
#include<vector>
#include<iomanip>
#include <cstdio>

using namespace std;

int main(){
    float w,h,x,y;cin >> w >> h >> x >> y;
    float m=0.0;
    int cnt = 0;
    float a,b = 0.0;
    m = w*h /2
    if(x*2 == w && y*2 == h)cnt = 1;
    cout << m << " " << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: expected ';' before 'if'
   18 |     m = w*h /2
      |               ^
      |               ;
   19 |     if(x*2 == w && y*2 == h)cnt = 1;
      |     ~~
Language: C++

#include<iostream>
#include<string>
#include<stdio.h>
#include <algorithm>
#include <set>
#include<math.h>
#include<vector>
#include<iomanip>
#include <cstdio>

using namespace std;

int main(){
    float w,h,x,y;cin >> w >> h >> x >> y;
    float m=0.0;
    int cnt = 0;
    float a,b = 0.0;
    m = w*h /2
    if(x*2 == w && y*2 == h)cout = 1;
    cout << m << " " << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: expected ';' before 'if'
   18 |     m = w*h /2
      |               ^
      |               ;
   19 |     if(x*2 == w && y*2 == h)cout = 1;
      |     ~~
Language: C

#include<stdio.h>
int main(){
  double h,w,x,y;
  scanf("%lf %lf %lf %lf",&w,&h,&x,&y);
  if(x == w/2 && y == h/2){
    printf("%lf %d",w*h/2),1);
  }else{
    printf("%lf %d",w*h/2),0);
  }
}

Compiler output:
main.c: In function 'main':
main.c:6:29: error: expected ';' before ')' token
    6 |     printf("%lf %d",w*h/2),1);
      |                             ^
      |                             ;
main.c:6:29: error: expected statement before ')' token
main.c:8:29: error: expected ';' before ')' token
    8 |     printf("%lf %d",w*h/2),0);
      |                             ^
      |                             ;
main.c:8:29: error: expected statement before ')' token
Language: C

#include<stdio.h>
int main(){
  int h,w,x,y;
  int s;
  scanf("%d %d %d %d",&w,&h,&x,&y);
  if(x == w/2 && y == h/2){
    printf("%lf %d",double(w*h/2),1);
  }else if(x == w/2 || y == h/2){
    printf("%lf %d",double(w*h/2),0);
  }else{
    if( x < w/2 && y < h/2){
      if( y*w <= x*h){
        printf("%lf %d",double(y*w),0);
      }else{
        printf("%lf %d",double(x*h),0);
      }
    }
    if( x < w/2 && y > h/2){
       if( (h-y)*w <= x*h){
          printf("%lf %d",double((h-y)*w),0);
        }else{
          printf("%lf %d",double(x*h),0);
        }
    }
     if( x > w/2 && y > h/2){
       if( (h-y)*w <= (w-x)*h){
          printf("%lf %d",double((h-y)*w),0);
        }else{
          printf("%lf %d",double((w-x)*h),0);
        }
     }
     if( x > w/2 && y < h/2){
       if(y*w <= (w-x)*h){
          printf("%lf %d",double(y*w),0);
        }else{
          printf("%lf %d",double((w-x)*h),0);
        }
     }
  }
}

Compiler output:
main.c: In function 'main':
main.c:7:21: error: expected expression before 'double'
    7 |     printf("%lf %d",double(w*h/2),1);
      |                     ^~~~~~
main.c:9:21: error: expected expression before 'double'
    9 |     printf("%lf %d",double(w*h/2),0);
      |                     ^~~~~~
main.c:13:25: error: expected expression before 'double'
   13 |         printf("%lf %d",double(y*w),0);
      |                         ^~~~~~
main.c:15:25: error: expected expression before 'double'
   15 |         printf("%lf %d",double(x*h),0);
      |                         ^~~~~~
main.c:20:27: error: expected expression before 'double'
   20 |           printf("%lf %d",double((h-y)*w),0);
      |                           ^~~~~~
main.c:22:27: error: expected expression before 'double'
   22 |           printf("%lf %d",double(x*h),0);
      |                           ^~~~~~
main.c:27:27: error: expected expression before 'double'
   27 |           printf("%lf %d",double((h-y)*w),0);
      |                           ^~~~~~
main.c:29:27: error: expected expression before 'double'
   29 |           printf("%lf %d",double((w-x)*h),0);
      |                           ^~~~~~
main.c:34:27: error: expected expression before 'double'
   34 |           printf("%lf %d",double(y*w),0);
      |                           ^~~~~~
main.c:36:27: error: expected expression before 'double'
   36 |           printf("%lf %d",double((w-x)*h),0);
      |                           ^~~~~~
Language: C++

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

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

  long long W, H, x, y;
  cin >> W >> H >> x >> y;
  cout << fixed << setprecision(10) << (double)H * (double)W / 2.0 << " " << ((x + x == H) && (y + y == W))?1:0 << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:113: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   16 |   cout << fixed << setprecision(10) << (double)H * (double)W / 2.0 << " " << ((x + x == H) && (y + y == W))?1:0 << endl;
      |                                                                                                               ~~^~~~~~~