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

#include <algorithm>
#include <iostream>

bool valid(int a, int b, int c) {
    return a <= b + c && b <= c + a + 1 && c <= a + b + 1;
}

void calc(int rear, int front, int west, int east, int north, int south, int limit, char* buffer) {
    bool same = true;
    for (int i = 0; i < limit; i++) {
        int a = rear + front;
        int b = west + east;
        int c = north + south;
        char y;
 
        int temp = rear;
        if (east > 0 && valid(b - 1, c, a)) {
            rear = east - 1;
            east = front;
            front = west;
            west = temp;
            y = 'E';
        } else if (north > 0 && valid(c - 1, a, b)) {
            rear = north - 1;
            north = front;
            front = south;
            south = temp;
            y = 'N';
        } else if (south > 0 && valid(c - 1, a, b)) {
            rear = south - 1;
            south = front;
            front = north;
            north = temp;
            y = 'S';
        } else {
            rear = west - 1;
            front = east;
            west = front;
            east = temp;
            y = 'W';
        }

        if (same) {
            char x = buffer[i];
            if (x < y) {
                return;
            }
            if (x > y) {
                same = false;
            }
        }
        buffer[i] = y;
    }
}

char* find(int target[6], int limit) {
    char* buffer = new char[limit + 1];
    std::memset(buffer, 'Z', limit);
    buffer[limit] = '\0';

    std::sort(target, target + 6);
    do {
        if (valid(target[0] + target[1], target[2] + target[3], target[4] + target[5])) {
            calc(target[0], target[1], target[2], target[3], target[4], target[5], limit, buffer);
        }
    } while (std::next_permutation(target, target + 6));

    return buffer;
}

int main() {
    int target[6];
    while (true) {
        bool nonzero = false;
        for (int i = 0; i < 6; i++) {
            std::cin >> target[i];
            nonzero = nonzero || target[i];
        }
        if (!nonzero) {
            break;
        }

        int p, q;
        std::cin >> p >> q;

        char* result = find(target, q);
        if (result[0] != 'Z') {
            std::cout << &result[p - 1] << std::endl;
            delete[] result;
        } else {
            std::cout << "impossible" << std::endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'char* find(int*, int)':
a.cc:58:10: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   58 |     std::memset(buffer, 'Z', limit);
      |          ^~~~~~
      |          wmemset
Language: C++

#include <algorithm>
#include <iostream>

bool valid(int a, int b, int c) {
    return a <= b + c && b <= c + a + 1 && c <= a + b + 1;
}

void calc(int rear, int front, int west, int east, int north, int south, int limit, char* buffer) {
    bool same = true;
    for (int i = 0; i < limit; i++) {
        int a = rear + front;
        int b = west + east;
        int c = north + south;
        char y;
 
        int temp = rear;
        if (east > 0 && valid(b - 1, c, a)) {
            rear = east - 1;
            east = front;
            front = west;
            west = temp;
            y = 'E';
        } else if (north > 0 && valid(c - 1, a, b)) {
            rear = north - 1;
            north = front;
            front = south;
            south = temp;
            y = 'N';
        } else if (south > 0 && valid(c - 1, a, b)) {
            rear = south - 1;
            south = front;
            front = north;
            north = temp;
            y = 'S';
        } else {
            rear = west - 1;
            front = east;
            west = front;
            east = temp;
            y = 'W';
        }

        if (same) {
            char x = buffer[i];
            if (x < y) {
                return;
            }
            if (x > y) {
                same = false;
            }
        }
        buffer[i] = y;
    }
}

char* find(int target[6], int limit) {
    char* buffer = new char[limit + 1];
    memset(buffer, 'Z', limit);
    buffer[limit] = '\0';

    std::sort(target, target + 6);
    do {
        if (valid(target[0] + target[1], target[2] + target[3], target[4] + target[5])) {
            calc(target[0], target[1], target[2], target[3], target[4], target[5], limit, buffer);
        }
    } while (std::next_permutation(target, target + 6));

    return buffer;
}

int main() {
    int target[6];
    while (true) {
        bool nonzero = false;
        for (int i = 0; i < 6; i++) {
            std::cin >> target[i];
            nonzero = nonzero || target[i];
        }
        if (!nonzero) {
            break;
        }

        int p, q;
        std::cin >> p >> q;

        char* result = find(target, q);
        if (result[0] != 'Z') {
            std::cout << &result[p - 1] << std::endl;
            delete[] result;
        } else {
            std::cout << "impossible" << std::endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'char* find(int*, int)':
a.cc:58:5: error: 'memset' was not declared in this scope
   58 |     memset(buffer, 'Z', limit);
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 |
Language: Java

import java.util.*;

public class Asia1998A{
	public static void main(String[] args){
		int max = (int)(Math.pow(2,15));
		int count=0;
		List<Integer> list = new ArrayList<Integer>(); 
		boolean[] a = new boolean[max];
		for(int i=0;i<max;i++){
			a[i] = true;
		}
		a[0]=false;
		a[1]=false;
		for(int i=2;i<max;i++){
			for(int j=2;j<max;j++){
				if(i*j < max) a[i*j] = false;
			}
		}
		for(int i=0;i<max;i++){
			if(a[i] == true){
				list.add(i);			
			}
		}
		//System.out.print(list);
		for(int i=0;i<max;i++){
			if(args[i].equals("0")) break;
			for(int j=0;j<list.size();j++){
				for(int k=0;k<list.size();k++){
					int first = list.get(j).intValue();
					int second = list.get(k).intValue();
					//System.out.println(first);
					if(first+second == Integer.parseInt(args[i]) && first<=second) count++;
				}
			}
			System.out.println(count);
			count = 0;
		}
	}
}

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

import java.util.*;

public class Asia1998A{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int max = (int)(Math.pow(2,15));
		int count=0;
		List<Integer> list = new ArrayList<Integer>(); 
		boolean[] a = new boolean[max];
		for(int i=0;i<max;i++){
			a[i] = true;
		}
		a[0]=false;
		a[1]=false;
		for(int i=2;i<max;i++){
			for(int j=2;j<max;j++){
				if(i*j < max) a[i*j] = false;
			}
		}
		for(int i=0;i<max;i++){
			if(a[i] == true){
				list.add(i);			
			}
		}
		//System.out.print(list);
		for(int i=0;i<max;i++){
			int num = scan.nextInt(); 
			if(num==0) break;
			for(int j=0;j<list.size();j++){
				for(int k=0;k<list.size();k++){
					int first = list.get(j).intValue();
					int second = list.get(k).intValue();
					//System.out.println(first);
					if(first+second == num && first<=second) count++;
				}
			}
			System.out.println(count);
			count = 0;
		}
	}
}

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

class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int max = (int)(Math.pow(2,15));
		int count=0;
		List<Integer> list = new ArrayList<Integer>(); 
		boolean[] a = new boolean[max];
		for(int i=0;i<max;i++){
			a[i] = true;
		}
		a[0]=false;
		a[1]=false;
		for(int i=2;i<max;i++){
			for(int j=2;i*j<max;j++){
				if(i*j < max) a[i*j] = false;
			}
		}
		for(int i=0;i<max;i++){
			if(a[i] == true){
				list.add(i);			
			}
		}
		//System.out.print(list);
		while(scan.hasNext()){
			int num = scan.nextInt(); 
			for(int j=0;j<list.size();j++){
				for(int k=0;k<list.size();k++){
					int first = list.get(j).intValue();
					int second = list.get(k).intValue();
					//System.out.println(first);
					if(first+second == num && first<=second) count++;
				}
			}
			System.out.println(count);
			count = 0;
		}
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
		List<Integer> list = new ArrayList<Integer>(); 
		^
  symbol:   class List
  location: class Main
Main.java:6: error: cannot find symbol
		List<Integer> list = new ArrayList<Integer>(); 
		                         ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: C

//50000 for aizu0056
//1000000 for aizu0185
#define M 32769
p[M+1];main(n,i,j){
  p[1]=1;
  for(;i<=M;i++)
    if(!p[i])
      for(j=i*2;j<=M;j+=i)
        p[j]=1;
  for(;scanf("%d",&n),n;printf("%d\n",s))
    for(i=2,j=0;i<=n/2;i++)
      if(!p[i]&&!p[n-i])j++;
  return 0;
}

Compiler output:
main.c:4:1: warning: data definition has no type or storage class
    4 | p[M+1];main(n,i,j){
      | ^
main.c:4:1: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
main.c:4:8: error: return type defaults to 'int' [-Wimplicit-int]
    4 | p[M+1];main(n,i,j){
      |        ^~~~
main.c: In function 'main':
main.c:4:8: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:4:8: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:4:8: error: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:10:8: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   10 |   for(;scanf("%d",&n),n;printf("%d\n",s))
      |        ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | //50000 for aizu0056
main.c:10:8: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   10 |   for(;scanf("%d",&n),n;printf("%d\n",s))
      |        ^~~~~
main.c:10:8: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |   for(;scanf("%d",&n),n;printf("%d\n",s))
      |                         ^~~~~~
main.c:10:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:39: error: 's' undeclared (first use in this function)
   10 |   for(;scanf("%d",&n),n;printf("%d\n",s))
      |                                       ^
main.c:10:39: note: each undeclared identifier is reported only once for each function it appears in
Language: C

//50000 for aizu0056
//1000000 for aizu0185
#define M 32769
p[M+1];


int main(){
  int n,i=2,j;
  p[1]=1;
  for(;i<=IN_MAX;i++)
    if(!p[i])
      for(j=i*2;j<=IN_MAX;j+=i)
        p[j]=1;
  for(;scanf("%d",&n),n;){
    int i=2,s=0;
    for(;i<=n/2;i++){
      if(p[i])continue;
      if(!p[n-i]){
        s++;
      }
    }
    printf("%d\n",s);
  }
  return 0;
}

Compiler output:
main.c:4:1: warning: data definition has no type or storage class
    4 | p[M+1];
      | ^
main.c:4:1: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
main.c: In function 'main':
main.c:10:11: error: 'IN_MAX' undeclared (first use in this function)
   10 |   for(;i<=IN_MAX;i++)
      |           ^~~~~~
main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:8: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   14 |   for(;scanf("%d",&n),n;){
      |        ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | //50000 for aizu0056
main.c:14:8: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   14 |   for(;scanf("%d",&n),n;){
      |        ^~~~~
main.c:14:8: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:22:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   22 |     printf("%d\n",s);
      |     ^~~~~~
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int prime[20000];
int n;
int main()
{
int i,j,count;
 for(i=2;i<10002;i++)
  {
   if(prime[i]==1)
	continue;
   for(j=i+i;j<20000;j+=i)
	prime[j]=1;
  }

for(;scanf("%d",&n),n;)
  { 
     count=0;
    for(i=2;i<n;i++)
     {
      for(j=2;i+j<=n;j++)
       {
         if(i+j==n && prime[i]==1 &&prime[j]==1)
          count++;
       }
     }
   print("%d\n",conut);
  }
}

Compiler output:
main.c: In function 'main':
main.c:26:4: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   26 |    print("%d\n",conut);
      |    ^~~~~
      |    printf
main.c:26:17: error: 'conut' undeclared (first use in this function); did you mean 'count'?
   26 |    print("%d\n",conut);
      |                 ^~~~~
      |                 count
main.c:26:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

import math
primes=[2]
top=2
nlist=[2*x-1 for x in range(2,2**13)]
while top<math.sqrt(2**14):
    top=nlist[0]
    primes.append(top)
    newnlist=[]
    for i in nlist:
        if i%top!=0:
            newnlist.append(i)
    nlist=newnlist
primes=primes+nlist
print primes
while(1):
    n=int(raw_input())
    if n==0:
        break
    else:
        sum=0
        for i in range(2,n/2+1):
            if i in primes and n-i in primes:
                print (i,n-i)
                sum=sum+1
        print sum

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<map>
using namespace std;
int main() {
	bool b[300];
	int n;
	fill(b, b + 300, true);
	b[0] = false;
	b[1] = false;
	for (int i = 2; i < 300; i++) {
		if (b[i]) {
			int j = 2;
			while (i*j < 300) {
				b[i*j] = false;
			}
		}
	}
	int n;
	while (cin >> n&&n != 0) {
		map<int, int>c;
		for (int i = 0; i < n / 2 + 10; i++) {
			if (b[i] && b[n - i]) {
				c.insert(map<int, int>::value_type(min(i, n - i),max(i,n-i)));
			}
		}
		cout << c.size << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: redeclaration of 'int n'
   22 |         int n;
      |             ^
a.cc:10:13: note: 'int n' previously declared here
   10 |         int n;
      |             ^
a.cc:30:22: error: invalid use of non-static member function 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::size() const [with _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; size_type = long unsigned int]'
   30 |                 cout << c.size << endl;
      |                 ~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/map:63,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_map.h:482:7: note: declared here
  482 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
bool b[33000];
int main() {	
	int n;
	fill(b, b + 33000, true);
	b[0] = false;
	b[1] = false;
	for (int i = 2; i < 33000; i++) {
		if (b[i]) {
			int j = 2;
			while (i*j < 33000) {
				b[i*j] = false;
			}
		}
	}
	int n;
	while (cin >> n&&n != 0) {
		map<int, int>c;
		for (int i = 0; i < n / 2 + 10; i++) {
			if (b[i] && b[n - i]) {
				c.insert(map<int, int>::value_type(min(i, n - i),max(i,n-i)));
			}
		}
		cout << c.size << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: redeclaration of 'int n'
   19 |         int n;
      |             ^
a.cc:7:13: note: 'int n' previously declared here
    7 |         int n;
      |             ^
a.cc:27:22: error: invalid use of non-static member function 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::size() const [with _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; size_type = long unsigned int]'
   27 |                 cout << c.size << endl;
      |                 ~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/map:63,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_map.h:482:7: note: declared here
  482 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
Language: C++

o[1<<20],n,r;
main(i){
 for(;++i<999;)
  if(!o[i])
   for(r=i+i;r<1<<20;r+=i)
    o[r]=1;
 for(;scanf("%d",&n),n;printf("%d\n",r))
  for(i=1,r=0;++i<=n/2;)
   o[i]+o[n-i]||r++;
 exit(0);
}

Compiler output:
a.cc:1:1: error: 'o' does not name a type
    1 | o[1<<20],n,r;
      | ^
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(i){
      |     ^
Language: C++

include <iostream>
#define MAX 1000000

using namespace std;

bool prime[MAX];

void isPrime(void){

  fill(prime, prime + MAX, true);
  prime[0] = prime[1] = false;
  for(int i = 0 ; i*i < MAX ; i++){
    if(prime[i]){
      for(int j = i*i ; j < MAX ; j += i){
	prime[j] = false;
      }
    }
  }
}

int main(void){

  isPrime();

  int n;
  while(cin >> n, n){
    int cnt = 0;
    for(int i = 2 ; n - i >= i ; i++){
      if(prime[i] && prime[n - i]) 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 'void isPrime()':
a.cc:10:3: error: 'fill' was not declared in this scope
   10 |   fill(prime, prime + MAX, true);
      |   ^~~~
a.cc: In function 'int main()':
a.cc:26:9: error: 'cin' was not declared in this scope
   26 |   while(cin >> n, n){
      |         ^~~
a.cc:31:5: error: 'cout' was not declared in this scope
   31 |     cout << cnt << endl;
      |     ^~~~
a.cc:31:20: error: 'endl' was not declared in this scope
   31 |     cout << cnt << endl;
      |                    ^~~~
Language: Java

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

//Lattice Practices
public class Main{

	String[] s;
	String[] rev;
	char[][] m;
	boolean[] u;
	Set<String> set;
	int c = 0;

	char[][] rotate(char[][] t){
		char[][] r = new char[5][5];
		for(int i=0;i<5;i++)for(int j=0;j<5;j++)r[i][j] = t[4-j][i];
		return r;
	}

	char[][] mirror(char[][] t){
		char[][] r = new char[5][5];
		for(int i=0;i<5;i++)for(int j=0;j<5;j++)r[i][j] = t[4-i][j];
		return r;
	}

	String get(char[][] t){
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<5;i++)for(int j=0;j<5;j++)sb.append(t[i][j]);
		return sb.toString();
	}

	boolean match(String a, String b){
		for(int i=0;i<5;i++)if(a.charAt(i)==b.charAt(i))return false;
		return true;
	}

	int x = 0;

	void f(int k){
		if(k==5){
			String[] v = new String[5];
			for(int j=0;j<5;j++){
				char[] t = new char[5];
				for(int i=0;i<5;i++)t[i]=m[i][j];
				v[j] = new String(t);
			}
			boolean[] w = new boolean[10];
			char[][] f = new char[5][5];
			for(int i=0;i<5;i++){
				boolean match = false;
				for(int j=0;j<10;j++){
					if(u[j]||w[j])continue;
					if(match(v[i], s[j])){
						w[j] = true;
						match = true;
						f[i] = s[j].toCharArray();
						break;
					}
					else if(match(v[i], rev[j])){
						w[j] = true;
						match = true;
						f[i] = rev[j].toCharArray();
						break;
					}
				}
				if(!match)return;
			}
			String ans = get(m);
			if(!set.contains(ans)){
				c++;
				set.add(ans);
				set.add(get(mirror(m)));
				set.add(get(rotate(rotate(m))));
				set.add(get(mirror(rotate(rotate(m)))));
				set.add(get(f));
				set.add(get(mirror(f)));
				set.add(get(rotate(rotate(f))));
				set.add(get(mirror(rotate(rotate(f)))));
			}
			return;
		}
		for(int i=0;i<10;i++){
			if(!u[i]){
				u[i] = true;
				m[k] = s[i].toCharArray();
				f(k+1);
				if(!s[i].equals(rev[i])){
					m[k] = rev[i].toCharArray();
					f(k+1);
				}
				u[i] = false;
			}
		}
	}

	void run(){
		Scanner sc = new Scanner(System.in);
		while(true){
			s = sc.nextLine().split(" ");
			if(s.length==1)break;
			rev = new String[10];
			for(int i=0;i<10;i++){
				StringBuilder sb = new StringBuilder(s[i]);
				rev[i] = sb.reverse().toString();
			}
			u = new boolean[10];
			m = new char[5][5];
			c = 0;
			set = new HashSet<String>();
			f(0);
			System.out.println(c);
		}
	}

	public static void main(String[] args) {
		new M().run();
	}
}

Compiler output:
Main.java:117: error: cannot find symbol
		new M().run();
		    ^
  symbol:   class M
  location: class Main
1 error
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);
	vs lattices(10);


int dfs(int n,vi &used,vi &bottom,vi &lr){
	if(n==5){
		vs matrix(5);
		REP(i,5){
			string s=lattices[bottom[i]];
			if(lr[i]){
				s=string(s.rbegin(),s.rend());
			}
			REP(j,5){
				s[j]=s[j]=='1'?'0':'1';
			}
			matrix[i]=s;
		}
		REP(j,10){
			if(!used[j]){
				REP(k,5){
					REP(d,2){
						REP(l,5){
							if(d==0&&lattices[j][l]!=matrix[l][k]){
								goto a;
							}else if(d==1&&lattices[j][4-l]!=matrix[l][k]){
								goto a;
							}
						}
						goto b;
a:;
					}
				}
				return 0;
			}
			b:;
		}
		return 1;
	}

	int res=0;
	REP(i,10){
		if(used[i])continue;
		vi nused(used); 
		nused[i]=1;
		vi nbottom(bottom);
		nbottom[n]=i;
		int ss=2;
		if(lattices[i][0]==lattices[i][4]&&lattices[i][1]==lattices[i][3]){
			ss=1;
		}
		REP(j,ss){
			vi nlr(lr);
			nlr[n]=j;
			res+=dfs(n+1,nused,nbottom,nlr);
		}
	}
	return res;
}

int main(){
	while(cin>>lattices[0],lattices[0]!="END"){
		REP(i,9){
			cin>>lattices[i+1];
		}

		int ans=dfs(0,vi(10,0),vi(5),vi(5));
		cout<<ans/8<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:102:31: error: cannot bind non-const lvalue reference of type 'vi&' {aka 'std::vector<int>&'} to an rvalue of type 'vi' {aka 'std::vector<int>'}
  102 |                 int ans=dfs(0,vi(10,0),vi(5),vi(5));
      |                               ^~~~~~~~
a.cc:41:19: note:   initializing argument 2 of 'int dfs(int, vi&, vi&, vi&)'
   41 | int dfs(int n,vi &used,vi &bottom,vi &lr){
      |               ~~~~^~~~
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);
	string lattices[10];


int dfs(int n,vi &used,vi &bottom,vi &lr){
	if(n==5){
		vs matrix(5);
		REP(i,5){
			string s=lattices[bottom[i]];
			if(lr[i]){
				s=string(s.rbegin(),s.rend());
			}
			REP(j,5){
				s[j]=s[j]=='1'?'0':'1';
			}
			matrix[i]=s;
		}
		REP(j,10){
			if(!used[j]){
				REP(k,5){
					REP(d,2){
						REP(l,5){
							if(d==0&&lattices[j][l]!=matrix[l][k]){
								goto a;
							}else if(d==1&&lattices[j][4-l]!=matrix[l][k]){
								goto a;
							}
						}
						goto b;
a:;
					}
				}
				return 0;
			}
b:;
		}
		return 1;
	}

	int res=0;
	REP(i,10){
		if(used[i])continue;
		vi nused(used); 
		nused[i]=1;
		vi nbottom(bottom);
		nbottom[n]=i;
		int ss=2;
		if(lattices[i][0]==lattices[i][4]&&lattices[i][1]==lattices[i][3]){
			ss=1;
		}
		REP(j,ss){
			vi nlr(lr);
			nlr[n]=j;
			res+=dfs(n+1,nused,nbottom,nlr);
		}
	}
	return res;
}

int main(){
	while(cin>>lattices[0],lattices[0]!="END"){
		REP(i,9){
			cin>>lattices[i+1];
		}

		int ans=dfs(0,vi(10,0),vi(5),vi(5));
		cout<<ans/8<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:102:31: error: cannot bind non-const lvalue reference of type 'vi&' {aka 'std::vector<int>&'} to an rvalue of type 'vi' {aka 'std::vector<int>'}
  102 |                 int ans=dfs(0,vi(10,0),vi(5),vi(5));
      |                               ^~~~~~~~
a.cc:41:19: note:   initializing argument 2 of 'int dfs(int, vi&, vi&, vi&)'
   41 | int dfs(int n,vi &used,vi &bottom,vi &lr){
      |               ~~~~^~~~
Language: C++

        if(itr_tmp != mp.end()){
          cout << " ";
        }
      }
      
    }
    cout << "\n"; 
    /*
    REPI(itr, s){
      cout << *itr;
    }
    cout << endl;
    */
  }
  return 0;
}




Compiler output:
a.cc:1:9: error: expected unqualified-id before 'if'
    1 |         if(itr_tmp != mp.end()){
      |         ^~
a.cc:4:7: error: expected declaration before '}' token
    4 |       }
      |       ^
a.cc:6:5: error: expected declaration before '}' token
    6 |     }
      |     ^
a.cc:7:5: error: 'cout' does not name a type
    7 |     cout << "\n";
      |     ^~~~
a.cc:14:3: error: expected declaration before '}' token
   14 |   }
      |   ^
a.cc:15:3: error: expected unqualified-id before 'return'
   15 |   return 0;
      |   ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	string s;
	while(getline(cin,s)){
		string t="";
		set<string>out,not;
		rep(i,s.size())if(isalpha(s[i]))t+=toupper(s[i]);
		rep(i,t.size())loop(j,3,t.size()+1)if(i+j<=t.size()){
			string a=t.substr(i,j),b=a;
			reverse(all(b));
			if(a==b){
				out.insert(a);
				not.insert(t.substr(i+1,j-2));
			}
		}
		vector<string>ans;
		for(set<string>::iterator it=out.begin();it!=out.end();it++)
			if(not.find(*it)==not.end())
				ans.pb(*it);
		rep(i,ans.size()){
			if(i)cout<<" ";
			cout<<ans[i];
		}
		cout<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:32: error: expected unqualified-id before 'not' token
   37 |                 set<string>out,not;
      |                                ^~~
a.cc:44:36: error: expected primary-expression before '.' token
   44 |                                 not.insert(t.substr(i+1,j-2));
      |                                    ^
a.cc:49:31: error: expected primary-expression before '.' token
   49 |                         if(not.find(*it)==not.end())
      |                               ^
a.cc:49:46: error: expected primary-expression before '.' token
   49 |                         if(not.find(*it)==not.end())
      |                                              ^
Language: C++

import java.util.Scanner;

public class Main{
    Main(){
	Scanner sc = new Scanner(System.in);
	int c = 0;

	while(sc.hasNext()){
	    String str = (sc.nextLine()).replace(',',' ');
	    str = str.replace('.',' ').replace('"', ' ').replace('\'', ' ');
	    str = str.replace(':', ' ');
	    String[] st = str.split(" ");
	    str = "";
	    for(int i = 0; i < st.length; i++){
		str += st[i].toUpperCase();
	    }
	    char[] ch = str.toCharArray();
	    st = new String[1024];
	    int t = 0, p, q;
	    for(int i = 1; i < str.length(); i++){
		for(p = i-1, q = i+1; p >= 0 && q < str.length(); p--, q++){
		    if(ch[p] != ch[q]){
			break;
		    }
		}
		p++;
		q--;
		if(q != p){
		    String str2 = "";
		    for(int j = p; j <= q; j++){
			str2 += ch[j];
		    }

		    int r = q-i, f = 0, d;
		    for(int j = 0; j < t; j++){
			String str3 = st[j];
			int l = str3.length();
			if(l%2 == 0){
			    continue;
			}
			if(l > q-p+1){
			    d = l/2;
			    if(d+r+1 < str3.length() && str2.equals(str3.substring(d-r, d+r+1))){
				f = 2;
				break;
			    }
			} else if(l == q-p+1){
			    if(str3.equals(str2)){
				f = 2;
				break;
			    }
			} else {
			    d = str2.length()/2;
			    if(d+l/2+1 < str2.length() && str3.equals(str2.substring(d-l/2, d+l/2+1))){
				f = 1;
				r = j;
				break;
			    }
			}
		    }
		    if(f == 0){
			st[t++] = str2;
		    } else if(f == 1){
			st[r] = str2;
		    }
		}
		for(p = i-1, q = i; p >= 0 && q < str.length(); p--, q++){
		    if(ch[p] != ch[q]){
			break;
		    }
		}
		p++;
		q--;
		if(ch[q] == ch[p]){
		    String str2 = "";
		    for(int j = p; j <= q; j++){
			str2 += ch[j];
		    }

		    int r = (q-p+1)/2, f = 0, d;
		    for(int j = 0; j < t; j++){
			String str3 = st[j];
			int l = str3.length();
			if(l%2 == 1){
			    continue;
			}
			if(l > q-p+1){
			    d = l/2;
			    if(str2.equals(str3.substring(d-r, d+r))){
				f = 2;
				break;
			    }  
			} else if(l == q-p+1){
			    if(str3.equals(str2)){
				f = 2;
				break;
			    }
			} else {
			    d = str2.length()/2;
			    if(str3.equals(str2.substring(d-l/2, d+l/2))){
				f = 1;
				r = j;
				break;
			    }
			}
		    }
		    if(f == 0){
			st[t++] = str2;
		    } else if(f == 1){
			st[r] = str2;
		    }
		    
		}
	    }
	    
	    for(int i = t-1; i >= 0; i--){
		for(int j = 1; j <= i; j++){
		    if(st[j-1].length() < st[j].length()){
			str = st[j-1];
			st[j-1] = st[j];
			st[j] = str;
		    } else if(st[j-1].length() == st[j].length() && st[j-1].compareTo(st[j]) < 0){
			str = st[j-1];
			st[j-1] = st[j];
			st[j] = str;
		    }
		}
	    }
	    
	    if(t > 0){
		System.out.print(st[0]);
		for(int i = 1; i < t; i++){
		    System.out.print(" "+st[i]);
		}
	    }
	    System.out.println();
	}
    }

    public static void main(String[] args){
	new Main();
    }
}

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++

import java.util.Scanner;

public class p1203{
    p1203(){
	Scanner sc = new Scanner(System.in);
	int c = 0;

	while(sc.hasNext()){
	    String str = (sc.nextLine()).replace(',',' ');
	    str = str.replace('.',' ').replace('"', ' ').replace('\'', ' ');
	    str = str.replace(':', ' ');
	    String[] st = str.split(" ");
	    str = "";
	    for(int i = 0; i < st.length; i++){
		str += st[i].toUpperCase();
	    }
	    char[] ch = str.toCharArray();
	    st = new String[1024];
	    int t = 0, p, q;
	    for(int i = 1; i < str.length(); i++){
		for(p = i-1, q = i+1; p >= 0 && q < str.length(); p--, q++){
		    if(ch[p] != ch[q]){
			break;
		    }
		}
		p++;
		q--;
		if(q != p){
		    String str2 = "";
		    for(int j = p; j <= q; j++){
			str2 += ch[j];
		    }

		    int r = q-i, f = 0, d;
		    for(int j = 0; j < t; j++){
			String str3 = st[j];
			int l = str3.length();
			if(l%2 == 0){
			    continue;
			}
			if(l > q-p+1){
			    d = l/2;
			    if(d+r+1 < str3.length() && str2.equals(str3.substring(d-r, d+r+1))){
				f = 2;
				break;
			    }
			} else if(l == q-p+1){
			    if(str3.equals(str2)){
				f = 2;
				break;
			    }
			} else {
			    d = str2.length()/2;
			    if(d+l/2+1 < str2.length() && str3.equals(str2.substring(d-l/2, d+l/2+1))){
				f = 1;
				r = j;
				break;
			    }
			}
		    }
		    if(f == 0){
			st[t++] = str2;
		    } else if(f == 1){
			st[r] = str2;
		    }
		}
		for(p = i-1, q = i; p >= 0 && q < str.length(); p--, q++){
		    if(ch[p] != ch[q]){
			break;
		    }
		}
		p++;
		q--;
		if(ch[q] == ch[p]){
		    String str2 = "";
		    for(int j = p; j <= q; j++){
			str2 += ch[j];
		    }

		    int r = (q-p+1)/2, f = 0, d;
		    for(int j = 0; j < t; j++){
			String str3 = st[j];
			int l = str3.length();
			if(l%2 == 1){
			    continue;
			}
			if(l > q-p+1){
			    d = l/2;
			    if(str2.equals(str3.substring(d-r, d+r))){
				f = 2;
				break;
			    }  
			} else if(l == q-p+1){
			    if(str3.equals(str2)){
				f = 2;
				break;
			    }
			} else {
			    d = str2.length()/2;
			    if(str3.equals(str2.substring(d-l/2, d+l/2))){
				f = 1;
				r = j;
				break;
			    }
			}
		    }
		    if(f == 0){
			st[t++] = str2;
		    } else if(f == 1){
			st[r] = str2;
		    }
		    
		}
	    }
	    
	    for(int i = t-1; i >= 0; i--){
		for(int j = 1; j <= i; j++){
		    if(st[j-1].length() < st[j].length()){
			str = st[j-1];
			st[j-1] = st[j];
			st[j] = str;
		    } else if(st[j-1].length() == st[j].length() && st[j-1].compareTo(st[j]) < 0){
			str = st[j-1];
			st[j-1] = st[j];
			st[j] = str;
		    }
		}
	    }
	    
	    if(t > 0){
		System.out.print(st[0]);
		for(int i = 1; i < t; i++){
		    System.out.print(" "+st[i]);
		}
	    }
	    System.out.println();
	}
    }

    public static void main(String[] args){
	new p1203();
    }
}

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 p1203{
      | ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>

using namespace std;

bool used[2000];
bool check(string s){
    for(int i = 0; i < s.size()/2; i++){
        if(s[i]==s[s.size()-1-i])
            continue;
        else
            return false;
    }
    return true;
}

int main(){

    string str;
    while(getline(cin,str)){

        memset(used,0,sizeof(used));
        string s;
        for(int i = 0; i < str.size(); i++){
            if((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z')){
                s+=toupper(str[i]);
            }
        }
        set<string> ss;
        for(int i = s.size(); i >= 3; i--){
            for(int j = 0; j + i -1 < s.size(); j++){
                if(check(s.substr(j,i))){
                    ss.insert(s.substr(j,i));
                }
            }
        }
        vector<string> tmps=vector<string>(ss.begin(),ss.end());
        for(int i = 0; i < tmps.size(); i++){
            for(int j = i+1; j < tmps.size(); j++){
                if(tmps[i].size()<tmps[j].size()){
                    int diff=tmps[j].size()-tmps[i].size();
                    diff/=2;
                    if(tmps[j].substr(diff,tmps[i].size())==tmps[i]){
                        used[i]=true;
                    }
                }
                else{
                    int diff=tmps[i].size()-tmps[j].size();
                    diff/=2;
                    if(tmps[i].substr(diff,tmps[j].size())==tmps[j]){
                        used[j]=true;
                    }
                }
            }
        }
        ss.clear();
        for(int i = 0; i < tmps.size(); i++){
            if(!used[i])
                ss.insert(tmps[i]);
        }
        for(set<string>::iterator it=ss.begin();it!=ss.end();it++){
            cout<<*it;
            set<string>::iterator iit=it;
            iit++;
            if(iit==ss.end()){
                cout<<endl;
            }
            else
                cout<<" ";
        }
        if(ss.size()==0)cout<<endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'memset' was not declared in this scope
   25 |         memset(used,0,sizeof(used));
      |         ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <set>
  +++ |+#include <cstring>
    6 |
Language: C++

#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <memory.h>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cctype>
#include <iomanip>
#include <sstream>
#include <cctype>
#include <fstream>
#include <cmath>
using namespace std;

#define REP2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define REP(i, n) REP2(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
#define ITER(c) __typeof((c).begin())
#define PB(e) push_back(e)
#define FOREACH(i, c) for(ITER(c) i = (c).begin(); i != (c).end(); ++i)
#define MP(a, b) make_pair(a, b)
#define PARITY(n) ((n) & 1)

typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1000 * 1000 * 1000 + 7;
const double EPS = 1e-10;

int N;
int table[20];
int reserv[210];

void dfs(int task, int pos, int &res){
  // cout << task << " "<< pos << " " << res << endl;
  if(pos + N >= res) return ;
  if(task == 10){
    res = min(pos + N, res);
    return;
  }
  
  for(int npos = pos; npos <= pos + N; npos++){
    bool ok = true;
    REP(j, N)if(reserv[npos + j] & table[j]){
      ok = false;
      break;
    }
    if(ok){
      REP(j, N) reserv[npos + j] |= table[j];
      dfs(task + 1, npos, res);
      REP(j, N) reserv[npos + j] ^= table[j];
    }
  }
}

int main(){
  while(cin >> N, N){
    string str;
    memset(table, 0, sizeof(table));
    memset(reserv, 0, sizeof(reserv));
    
    REP(i, 5){
      cin >> str;
      REP(j, N) if(str[j] == 'X') table[j] |= (1 << i);
    }
    REP(i, N) reserv[i] = table[i];
    int res = INF;
    dfs(1, 0, res);
    cout << res << endl;
  }
  return 0;
}

]

Compiler output:
a.cc:78:1: error: expected unqualified-id before ']' token
   78 | ]
      | ^
Language: C++

#include <iostream>

int main()
{
  cout<<"NO"<<endl;
  for(long long int i=0; i<1000*1000*1000; i++){
    //
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   cout<<"NO"<<endl;
      |   ^~~~
      |   std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:5:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 |   cout<<"NO"<<endl;
      |               ^~~~
      |               std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <cstring>
#include <cctype>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <complex>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for(int i = a; i < (int)b; i++)
#define pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;
const int INF = 1<<28;
const ll MOD = 1000000007;

int n;
double p, l, r;
string ansl, ansr;

void sternBrocot(int pl, int ql, int pr, int qr) {
	int pm = pl + pr, qm = ql + qr;
	double v = (double)pm / qm;
	if(pm >= n || qm >= n) return;
	if(p < v && v < r) {
		r = v;
		ansr = to_string(pm) + '/' + to_string(qm);
	}
	if(v < p && l < v) {
		l = v;
		ansl = to_string(pm) + '/' + to_string(qm);
	}
	sternBrocot(pl, ql, pm, qm);
	sternBrocot(pm, qm, pr, qr);
}
int main() {
	l = 0; r = INF;
	while(cin >> p >> n, p|n) {
		p = sqrt(p);
		sternBrocot(0, 1, 1, 0);
		cout << ansr << ' ' << ansl << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:31: error: invalid operands of types 'double' and 'int' to binary 'operator|'
   52 |         while(cin >> p >> n, p|n) {
      |                              ~^~
      |                              | |
      |                              | int
      |                              double
Language: C++

#include<iostream>
#include<cmath>
#include<vector>

using namespace std;

int L;
vector<pair<int, int> > R;

double sp;

void sternBrocot(int x=0, int y=1, int z=1, int w=0){
    if ( w > 0 && y > 0&& !(1.0*x/y < sp && sp < 1.0*z/w) ) return;
    int num = x+z;
    int den = y+w;
    if ( num > L || den > L) return;
    sternBrocot(x, y, num, den);
    R.push_back(make_pair(num, den));
    sternBrocot(num, den, z, w);
}

main(){
    int p, n;
    while( cin >> p >> n && p && n ){
	L = n;
	R.clear();
	f = false;
	sp = sqrt(p);
	sternBrocot();
	pair<int, int> r1, r2;
	for ( int i = 0; i < R.size()-1; i++ ){
	    r1 = R[i];
	    r2 = R[i+1];
	    if ( 1.0*r1.first/r1.second < sp &&
		 sp < 1.0*r2.first/r2.second ){
		cout << r2.first << "/" << r2.second << " ";
		cout << r1.first << "/" << r1.second << endl;
	    }
	}
    }
}

Compiler output:
a.cc:22:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   22 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:27:9: error: 'f' was not declared in this scope
   27 |         f = false;
      |         ^
Language: C++

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

#define EPS (1e-6)

int p, n;
double sp;

int main(){
  while(cin >> p >> n, p || n){
    sp = sqrt(p);

    double maxVal = 0;
    double minVal = 999999999;
    int x = -1, y = -1, u = -1, v = -1;

    // j / i = sp
    for(int i = 1; i <= n; i++){
      int j = (int)floor(sp * i - EPS);
      int k = (int)ceil(sp * i + EPS);

      if(j <= n){
	double div = (double)j / i;

	if(maxVal < div){
	  maxVal = div;
	  u = j;
	  v = i;
	}
      }
      if(k <= n){
        double div = (double)k / i;

	if(minVal > div){
	  minVal = div;
	  x = k;
	  y = i;
	}
      }
    }

    int g = __gcd(x, y);
    x /= g;
    y /= g;

    g = __gcd(u, v);
    u /= g;
    v /= g;

    cout << x << "/" << y << " " << u << "/" << v << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:13: error: '__gcd' was not declared in this scope
   43 |     int g = __gcd(x, y);
      |             ^~~~~
Language: Java

#include<stdio.h>
#define rep(i,n,m) for((i)=(int)(n);(i)<=(int)(m);(i)++)

int memo[301];

int main(void){
  int i,j,n,coin[18];

  rep(i,0,16)coin[i]=(i+1)*(i+1);
  memo[0]=1;

  rep(i,0,16)rep(j,1,300)
    if(j>=coin[i])memo[j]+=memo[j-coin[i]];
  
  while(scanf("%d",&n),n)
    printf("%d\n",memo[n]);
  
  return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:2: error: illegal character: '#'
#define rep(i,n,m) for((i)=(int)(n);(i)<=(int)(m);(i)++)
^
Main.java:2: error: class, interface, enum, or record expected
#define rep(i,n,m) for((i)=(int)(n);(i)<=(int)(m);(i)++)
                                    ^
Main.java:2: error: class, interface, enum, or record expected
#define rep(i,n,m) for((i)=(int)(n);(i)<=(int)(m);(i)++)
                                                  ^
Main.java:15: error: not a statement
  while(scanf("%d",&n),n)
                       ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
int main(void){
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: <identifier> expected
int main(void){
             ^
Main.java:7: error: ']' expected
  int i,j,n,coin[18];
                 ^
Main.java:9: error: ';' expected
  rep(i,0,16)coin[i]=(i+1)*(i+1);
             ^
Main.java:12: error: ';' expected
  rep(i,0,16)rep(j,1,300)
             ^
Main.java:12: error: ';' expected
  rep(i,0,16)rep(j,1,300)
                         ^
Main.java:15: error: illegal start of expression
  while(scanf("%d",&n),n)
                   ^
Main.java:15: error: ')' expected
  while(scanf("%d",&n),n)
                      ^
Main.java:15: error: ';' expected
  while(scanf("%d",&n),n)
                        ^
15 errors
Language: C++

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

const int N = 18;
const int MAX_N = 301;

int value[N];
int dp[N][MAX_N];

void make_Table() {
  for(int i = 1 ; i < N ; i++) {
    value[i] = i * i;
  }
}

void solve() {
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  
  for(int i = 1 ; i < N ; i++) {
    for(int j = 0 ; j < MAX_N ; j++) {
      int prevalue = j - value[i];
      
      dp[i][j] = dp[i-1][j];
      if(prevalue >= 0) dp[i][j] += dp[i][prevalue];
    }
  }
}

int main() {
  int n;
  make_Table();
  solve();
  while(cin >> n, n) {
    cout << dp[N-1][n] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:18:3: error: 'memset' was not declared in this scope
   18 |   memset(dp, 0, sizeof(dp));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;