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

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

using namespace std;
const int MAX = 1000000;
bool isPrime[MAX] = {0};

void sieve(){
    bool find[MAX] = {0};
    int i;
    for(i=2;i*i < MAX;i++){
        if(find[i]) continue;
        isPrime[i] = true;
        for(int j=i;j<MAX;j++){
            if(j%i == 0){
                find[j] = true;
                isPrime[j] = false;
            }
        }
    }
    for(;i<MAX;i++){
        if(!find[i]) isPrime[i] = true;;
    }
}

int main(){
    sieve();

    while(true){
        int n,x;
        cin >> n >> x;
        if(n==0 && x==0) return 0;
        vector<int> R(n);
        for(int i=0;i<n;i++){
            cin >> R[i];
        }

        set<int> S;
        S.insert(0);
        for(int i=0;i<R.size();i++){
            for(set<int>::iterator it=S.begin();it!=S.end();++it){
                int newe = *it + R[i];
                if(newe > x) continue;
                S.insert(newe);
            }
        }
        int maxn = -1;
        for(set<int>::iterator it=S.begin();it!=S.end();++it){
            if(isPrime[*it] && *it > maxn) maxn = *it;
        }
        if(maxn == -1) cout << "NA" << endl;
        else cout << maxn << endl;
    }
    return 0;
}
b

Compiler output:
a.cc:59:1: error: 'b' does not name a type
   59 | b
      | ^
Language: C++

#include <iostream>
#define N 1000000 
using  namespace std;

int main(void){
	bool isprime[N+1];
	for(int i=0;i<=N;i++)
		isprime[i]=true;
	isprime[0]=isprime[1]=false;
	for(int i=2;i<=N;i++)
		if(isprime[i])
			for(int j=2*i;j<=N;j+=i)
				isprime[j]=false;
	bool budget[N+1];
	int n,m;
	while(cin >> n>>m,n|m){
		for(int i=0;i<=m;i++)
			budget[i]=false;
		int tmp;
		budget[0]=true;
		for(int i=0;i<n;i++){
			cin >> tmp;
			for(int j=0;j<=m;j++)
				if(budget[j]&&(j+tpm)<=m)
					budget[j+tmp]=true;
		}
		int MAX=0;
		for(int i=m;i>0;i--){
			if(budget[i]&isprime[i]){
				MAX=i;break;
			}
		}
		if(MAX)
			cout << MAX << endl;
		else
			cout << "NA" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:50: error: 'tpm' was not declared in this scope; did you mean 'tmp'?
   24 |                                 if(budget[j]&&(j+tpm)<=m)
      |                                                  ^~~
      |                                                  tmp
Language: C++

require 'Prime'

loop do
  n, x = gets.split.map(&:to_i)
  break if n.zero? && x.zero?
  pb = [true]
  n.times.map{ gets.to_i }.each do |p|
    (0..x-p).each do |i|
      pb[i+p] = true if pb[i]
    end
  end

  na = true
  x.step(2, -1) do |i|
    if pb[i] && i.prime?
      puts i
      na = false
      break
    end
  end

  puts "NA" if na
end

Compiler output:
a.cc:1:9: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    1 | require 'Prime'
      |         ^~~~~~~
a.cc:8:6: error: too many decimal points in number
    8 |     (0..x-p).each do |i|
      |      ^~~~
a.cc:1:1: error: 'require' does not name a type
    1 | require 'Prime'
      | ^~~~~~~
a.cc:7:27: error: expected unqualified-id before '.' token
    7 |   n.times.map{ gets.to_i }.each do |p|
      |                           ^
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>
#include <cmath>

using namespace std;

vector<int> primes;

void make_primes( int lim ) {
  vector<bool> vs( lim + 1 );
  fill( vs.begin(), vs.end(), true );
  vs[ 0 ] = vs[ 1 ] = false;
  const int l = (int)sqrt( lim );
  for ( int i = 2; i <= l; i++ ){
	if ( vs[ i ] ) {
	  for ( int j = i * i; j <= lim; j += i ) {
		vs[ j ] = false;
	  }
	}
  }
  for ( int i = 2; i <= lim; i++ ) {
	if ( vs[ i ] ) {
	  priems.push_back( i );
	}
  }
}

bool isPrime( int n ) {
  return binary_search( primes.begin(), primes.end(), n );
}

int main() {
  make_primes( 1000000 );
  while( true ) {
	int n, x;
	cin >> n >> x;
	if ( n == 0 and x == 0 ) break;
	vector<int> vs( n );
	for ( int i = 0; i < n; i++ ) {
	  cin >> vs[ i ];
	}
	sort( vs.begin(), vs.end() );
	vector<int> cs;
	cs.push_back( 0 );
	vector<int> indices( n );
	fill( indices.begin(), indices.end(), 0 );
	while( cs.back() <= x ) {
	  int mv = 100000000;
	  int mi = -1;
	  for ( int i = 0; i < n; i++ ) {
		if ( mv > cs[ indices[ i ] ] + vs[ i ] ) {
		  mi = i;
		  mv = cs[ indices[ i ] ] + vs[ i ];
		}
	  }
	  if ( cs.back() < mv ) {
		cs.push_back( mv );
	  } 
	  indices[ mi ]++;
	}
	reverse( cs.begin(), cs.end() );
	bool s = false;
	for ( int v : cs ) {
	  if ( isPrime( v ) ) {
		s = true;
		cout << v << endl;
		break;
	  }
	}
	if ( not s ) {
	  cout << "NA" << endl;
	}
  }
}

Compiler output:
a.cc: In function 'void make_primes(int)':
a.cc:26:11: error: 'priems' was not declared in this scope; did you mean 'primes'?
   26 |           priems.push_back( i );
      |           ^~~~~~
      |           primes
Language: C++

from datetime import datetime

def measure(f):
    measure_start = datetime.now()
    v = f()
    print(datetime.now() - measure_start)
    return v

input = raw_input
range = xrange
    
def init():
    table = [True] * 1000001
    table[0] = False
    table[1] = False
    n = len(table)

    def prime(p):
        for i in range(p + p, n, p):
            table[i] = False
    prime(2)
    prime(3)
    prime(5)
    prime(7)
    prime(11)
    prime(13)
    
    for i in range(2, n):
        if (i % 2 != 0 and i % 3 != 0 and i % 5 != 0 and
            i % 7 != 0 and i % 11 != 0 and i % 13 != 0):
            for j in range(i + i, n, i):
                table[j] = False
    return table
    
def solve(price, ps, is_prime):
    dp = [0] * ((price >> 5) + 1)

    def get(i):
        return ((dp[i >> 5] >> (i & 31)) & 1)

    def set(i, v):
        dp[i >> 5] |= (v << (i & 31))

    def get_p(i):
        return dp[i >> 5]
    def set_p(i, v):
        dp[i >> 5] |= v
        
    if ps[0] <= price:
        set(ps[0], 1)
    set(0, 1)

    for i in range(1, len(ps)):
        cur_p = ps[i]
        r = cur_p & 31
        rest = 0
        
        for p in range(cur_p, price + 1, 32):
            i1 = (p - cur_p) >> 5
            i2 = p >> 5
            v = dp[i1]
            dp[i2] |= (v << r) | rest
            v = dp[i1]
            dp[i2] |= (v << r) | rest
            v = dp[i1]
            dp[i2] |= (v << r) | rest
            v = dp[i1]
            dp[i2] |= (v << r) | rest
            v = dp[i1]
            dp[i2] |= (v << r) | rest
            v = dp[i1]
            dp[i2] |= (v << r) | rest
            
            rest = (v >> (32 - r)) & ((1 << r) - 1)
            
    p = -1
    for i in range(0, price + 1):
        if is_prime[i] and get(i) == 1:
            p = i
    if p == -1:
        print("NA")
    else:
        print(p)
    
def main():
    table = init()
    while True:
        n, price = map(int,input().split())
        if n == 0 and price == 0:
            return
        ps = []
        for i in range(n):
            ps.append(int(input()))
        solve(price, ps, table)

main()

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from datetime import datetime
      | ^~~~
Language: Java


import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

import scala.inline;
import scala.noinline;

public class Main {

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

	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			m = scanner.nextInt();
			n = scanner.nextInt();
			if ((m | n) == 0)
				break;
			map = new int[n][m];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					map[i][j] = scanner.nextInt();
				}
			}
			count = 0;
			for (int i = 0; i < m; i++) {
				slove(i, 0, 0);
			}
			System.out.println(count);
		}
	}

	private void slove(int x, int y, int r) {
		if (y == n) {
			count++;
			return;
		}
		if (x < 0 || x == m)
			return;

		if (map[y][x] == 1)
			return;
		if (map[y][x] == 2 && r != 1)
			return;

		if (y == n - 1) {
			count++;
			return;
		}
		if (map[y][x] == 2)
			slove(x, y + 2, 1);
		else
			for (int i = 0; i < 3; i++) {
				slove(x + i - 1, y + 1, i);
			}
	}

	int count;
	int m;
	int n;
	int[][] map;
}

Compiler output:
Main.java:6: error: package scala does not exist
import scala.inline;
            ^
Main.java:7: error: package scala does not exist
import scala.noinline;
            ^
2 errors
Language: Java

mport java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.Integer.parseInt;

/**
 * A New Plan of Aizu Ski Resort
 * PCK2009 ??????9
 */
public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		String[] words;

		while ((line = br.readLine()) != null && !line.isEmpty()) {

			int x, y;
			x = parseInt(line.substring(0, line.indexOf(' ')));
			y = parseInt(line.substring(line.indexOf(' ') + 1));
			if ((x | y) == 0) break;

			int[][] course = new int[y + 4][x + 2];
			int[][] dp = new int[y + 4][x + 2];

			for (int i = 0; i < y; i++) {
				words = br.readLine().split(" ");
				for (int j = 0; j < words.length; j++) {
					course[i + 2][j + 1] = parseInt(words[j]);
				}
			}

			//
			for (int i = 1; i < x + 1; i++) {
				if (course[2][i] == 0) dp[2][i] = 1;
			}

			for (int i = 2; i < y + 2; i++) {
				for (int j = 1; j < x + 1; j++) {
					switch (course[i][j]) {
						case 0:
							if (course[i - 1][j - 1] == 0) {
								dp[i][j] += dp[i - 1][j - 1];
							}
							if (course[i - 1][j] == 0) {
								dp[i][j] += dp[i - 1][j];
							}
							if (course[i - 1][j + 1] == 0) {
								dp[i][j] += dp[i - 1][j + 1];
							}
							if (course[i - 2][j] == 2) {
								dp[i][j] += dp[i - 2][j];
							}
							break;
						case 1:
							break;
						case 2:
							if (course[i - 1][j] == 0) {
								dp[i][j] += dp[i - 1][j];
							}
							if (course[i - 2][j] == 2) {
								dp[i][j] += dp[i - 2][j];
							}
							break;
					}
				}
			}
			for (int i = y + 2; i < y + 4; i++) {
				for (int j = 1; j < x + 1; j++) {
					if (course[i - 1][j] == 0) {
						dp[i][j] += dp[i - 1][j];
					}
					if (course[i - 2][j] == 2) {
						dp[i][j] += dp[i - 2][j];
					}
				}
			}

			//
			int sum = 0;
			for (int i = 1; i < x + 1; i++) sum += dp[y + 3][i];
			System.out.println(sum);
		}//end while
	}//end main
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.io.BufferedReader;
^
Main.java:2: error: class, interface, enum, or record expected
import java.io.IOException;
^
Main.java:3: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
Main.java:5: error: class, interface, enum, or record expected
import static java.lang.Integer.parseInt;
^
4 errors
Language: Java

import java.util.*;

public class Main {
	Scanner sc;
	int w,h;
	int[][] map;
	int[][] route;
	
	void printMap(){
		for(int i=0;i<h+2;i++) {
			for(int j =0;j<w+2;j++) {
				System.out.print(route[i][j] + " ");
			}
			System.out.print(" ");
			for(int j =0;j<w+2;j++) {
				System.out.print(map[i][j] + " ");
			}
			System.out.println();
		}
		System.out.println();
	}
	
	void run() {
		sc = new Scanner(System.in);
		while (true) {
			w = sc.nextInt();
			h = sc.nextInt();
			if(w==0&&h==0) break;
			map = new int[h+2][w+2];
			route = new int[h+2][w+2];
			for(int i=0;i<h;i++) for(int j=0;j<w+2;j++) { map[i][j] = 1; route[i][j] = 0; }
			for(int i=h;i<h+2;i++)for(int j=0;j<w+2;j++) { map[i][j] = 0; route[i][j] = 0; }
			for(int i=0;i<h;i++) for(int j=1;j<w+1;j++) map[i][j] = sc.nextInt();
			for(int j=1;j<w+1;j++) if(map[0][j] != 1) route[0][j] = 1;
			for(int i=0;i<h-1;i++) for(int j=1;j<w+1;j++){
//				if(j==1)printMap();
				if(map[i][j] == 0){
					if(map[i+1][j-1] == 0) route[i+1][j-1] += route[i][j];
					if(map[i+1][j] != 1) route[i+1][ j ] += route[i][j];
					if(map[i+1][j+1] == 0) route[i+1][j+1] += route[i][j];
				}
				else if(map[i][j] == 2) {
					if(map[i+2][j] != 1) route[i+2][ j ] += route[i][j];
				}
			}
			int ans = 0;
			for(int i=h-1;i<h+1;i++) for(int j=1;j<w+1;j++) {
				ans += route[i][j];
			}
			System.out.println(ans);
		}
	}
	public static void main(String[] args) {
		new Main.run();
	}
}

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

import java.util.Scanner;

public class Main2 {
	 
    static int X,Y,ans;
    static int[][] field;
    static int[][] count;
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        while(true){
            X=cin.nextInt();
            Y=cin.nextInt();
            ans=0;
            if(X+Y==0){
                break;
            }
            field = new int[Y+2][X+2];
            count = new int[Y+2][X+2];
            for(int i = 0;i<Y+2;i++){
                for(int j = 0;j<X+2;j++){
                    field[i][j]=-1;
                }
            }
            for(int i = 0;i<Y;i++){
                for(int j = 1;j<X+1;j++){
                    field[i][j]=cin.nextInt();
                }
            }
            for(int i = 1;i<X+1;i++){
            	count[0][i]=1;
            }
            for(int i = 0;i<Y-1;i++){
            	for(int j = 1;j<=X;j++){
            		if(field[i][j]==0){
            			if(field[i+1][j-1]!=2)
            				count[i+1][j-1]+=count[i][j];
            			count[i+1][j]+=count[i][j];
            			if(field[i+1][j+1]!=2)
            				count[i+1][j+1]+=count[i][j];
            		}
            		else if(field[i][j]==1){
            			count[i][j]=0;
            		}
            		else if(field[i][j]==2){
            			
            			count[i+2][j]+=count[i][j];
            		}
            	}
            }
            for(int i = 1;i<=X;i++){
            	if(field[Y-1][i]!=1)
            		count[Y][i]+=count[Y-1][i];
            }
            for(int i = 0;i<Y+2;i++){
            	for(int j = 0;j<X+2;j++){
            		//System.out.print(count[i][j]+" " );
            	}
            	//System.out.println();
            }
            for(int i = 0;i<X;i++){
            	//System.out.println(count[Y][i+1]);
            	ans+=count[Y][i+1];
            }
            System.out.println(ans);
        }
    }
}

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

import java.util.Scanner;

public class Main2 {

	static int H,W;
	static int[][] field;
	static int[][] dp;
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		for(;;){
			W=cin.nextInt();
			H=cin.nextInt();
			if(W+H==0)break;
			field=new int[H+2][W];
			dp=new int[H+2][W];
			for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					field[i][j]=cin.nextInt();
				}
			}
			for(int i=0;i<W;i++){
				if(field[0][i]==0)dp[0][i]=1;
			}
			for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					if(field[i][j]==0){
						if(i!=H-1){
							for(int k=-1;k<=1;k++){
								if(j+k<0||j+k>=W)continue;
								if(field[i+1][j+k]==1)continue;
								if(k!=0&&field[i+1][j+k]==2)continue;
								dp[i+1][j+k]+=dp[i][j];
							}							
						}
						else{
							dp[i+1][j]+=dp[i][j];
						}
					}
					else if(field[i][j]==2){
						dp[i+2][j]+=dp[i][j];
					}
				}
			}
			int ans=0;
			for(int i=H;i<H+2;i++){
				for(int j=0;j<W;j++){
					ans+=dp[i][j];
				}
			}
			System.out.println(ans);
			
		}
	}

}

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

#include<iostream>
using namespace std;
 
int main(){
        int x,y;
        while(cin>>x>>y,x){
                int D[16][16],P[16][16],ans=0;
                for(int i=0;i<256;i++)P[i/16][i%16]=0;
                for(int i=0;i<y;i++)for(int j=0;j<x;j++)cin>>D[i][j];
                for(int i=0;i<x;i++)if(!D[0][i])P[0][i]=1;
                for(int i=0;i<y-1;i++){
                        for(int j=0;j<x;j++){
                                if(!D[i][j]){
                                        P[i+1][j]+=P[i][j];
                                        if(j>0 && D[i + 1][j - 1] != 2)P[i+1][j-1]+=P[i][j];
                                        if(j<x-1 && D[i + 1][j + 1] != 2)P[i+1][j+1]+=P[i][j];
                                }
                                if(D[i][j]==2){
//                                        if(i+2>y-1)P[i+1][j]+=P[i][j];
                                        P[i+2][j]+=P[i][j];
                                }
                        }
                }
                for(int i=0;i<x;i++)ans+=P[y-1][i];
                cout<<ans<<endl;
        }
}
 

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

#include<iostream>
using namespace std;
 
int main(){
        int x,y;
        while(cin>>x>>y,x){
                int D[16][16],P[16][16],ans=0;
                for(int i=0;i<256;i++)P[i/16][i%16]=0;
                for(int i=0;i<y;i++)for(int j=0;j<x;j++)cin>>D[i][j];
                for(int i=0;i<x;i++)if(!D[0][i])P[0][i]=1;
                for(int i=0;i<y-1;i++){
                        for(int j=0;j<x;j++){
                                if(!D[i][j]){
                                        if (D[i + 1][j] != 1) P[i+1][j]+=P[i][j];
                                        if(j>0 && !D[i + 1][j - 1])P[i+1][j-1]+=P[i][j];
                                        if(j<x-1 && !D[i + 1][j + 1])P[i+1][j+1]+=P[i][j];
                                }
                                if(D[i][j]==2){
                                        if(i+2>y-1)P[i+1][j]+=P[i][j];
                                        else P[i+2][j]+=P[i][j];
                                }
                        }
                }
                for(int i=0;i<x;i++)ans+=P[y-1][i];
                cout<<ans<<endl;
        }
}
 

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

#include<iostream>
using namespace std;
 
int main(){
        int x,y;
        while(cin>>x>>y,x){
                int D[16][16],P[16][16],ans=0;
                for(int i=0;i<256;i++)P[i/16][i%16]=0;
                for(int i=0;i<y;i++)for(int j=0;j<x;j++)cin>>D[i][j];
                for(int i=0;i<x;i++)if(!D[0][i])P[0][i]=1;
                for(int i=0;i<y-1;i++){
                        for(int j=0;j<x;j++){
                                if(!D[i][j]){
                                        P[i+1][j]+=P[i][j];
                                        if(j>0&&!D[i+1][j-1])P[i+1][j-1]+=P[i][j];
                                        if(j<x-1&&!D[i+1][j+1])P[i+1][j+1]+=P[i][j];
                                }
                                if(D[i][j]==2){
                                        if(i==y-2) ans += P[i][j];
                                        else P[i+2][j]+=P[i][j];
                                }
                        }
                }
                for(int i=0;i<x;i++){
                        if (D[y - 1][i] != 1)ans+=P[y-1][i];
                }
                cout<<ans<<endl;
        }
}
 

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

#include<stdio.h>

int dx[3] = {-1, 0, 1};
int dy[3] = {1, 1, 1};

int main(void)
{
	int **map, f1, f2, f3, **temp, x, y, sum, px, py;
	
	while(scanf("%d %d", &x, &y) && y > 0)
	{
		map = new int *[y];
		temp = new int *[y];
		sum = 0;

		//マップ土地&動的計画作成
		for(f1 = 0; f1 < y; f1++)
		{
			map[f1] = new int [x];
			temp[f1] = new int [x];
		}
		//マップ構成入力&初期化
		for(f1 = 0; f1 < y; f1++)
		{
			for(f2 = 0; f2 < x; f2++)
			{
				scanf("%d",&map[f1][f2]);
				temp[f1][f2] = 0;
			}
		}
		//最上のスタート地点設定
		for(f1 = 0; f1 < x; f1++)
		{
			if(map[0][f1] != 1)
			{
				temp[0][f1] = 1;
				sum++;
			}
		}
		//探索
		if(y >= 2)
		{
			sum = 0;
			for(f1 = 0; f1 < y - 1; f1++)
			{
				for(f2 = 0; f2 < x; f2++)
				{
					if(map[f1][f2] == 0 && temp[f1][f2] > 0)
					{
						for(f3 = 0; f3 < 3; f3++)
						{
							//移動
							px = f2 + dx[f3];
							py = f1 + dy[f3];
							//範囲内か
							if(px >= 0 && px < x)
							{
								//同じｘ座標からのジャンプ台
								if(f3 == 1 && py < y - 1){
									//ｙ軸2つ先へ
									while(py < y - 1 && map[py][px] == 2)
										py += 2;
								}
								//着地した場所がゴール地点のｙ座標と同じで障害物にぶつかってないか
								//ゴール地点のｙ座標を超えたか
								if(py > y - 1 || py == y - 1 && map[py][px] != 1)
									sum += temp[f1][f2];
								//超えてないが、障害物がない地点に着地したか
								else if(map[py][px] == 0)
									temp[py][px] += temp[f1][f2];
							}
						}
					}
				}
			}
		}
		//出力
		printf("%d\n",sum);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:23: error: 'new' undeclared (first use in this function)
   12 |                 map = new int *[y];
      |                       ^~~
main.c:12:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:26: error: expected ';' before 'int'
   12 |                 map = new int *[y];
      |                          ^~~~
      |                          ;
main.c:13:27: error: expected ';' before 'int'
   13 |                 temp = new int *[y];
      |                           ^~~~
      |                           ;
main.c:19:38: error: expected ';' before 'int'
   19 |                         map[f1] = new int [x];
      |                                      ^~~~
      |                                      ;
main.c:20:39: error: expected ';' before 'int'
   20 |                         temp[f1] = new int [x];
      |                                       ^~~~
      |                                       ;
Language: C

#include<stdio.h>

int dx[3] = {-1, 0, 1};
int dy[3] = {1, 1, 1};

int main(void)
{
	int **map, f1, f2, f3, **temp, x, y, sum, px, py;
	
	while(scanf("%d %d", &x, &y) && y > 0)
	{
		map = new int *[y];
		temp = new int *[y];
		sum = 0;

		//マップ土地&動的計画作成
		for(f1 = 0; f1 < y; f1++)
		{
			map[f1] = new int [x];
			temp[f1] = new int [x];
		}
		//マップ構成入力&初期化
		for(f1 = 0; f1 < y; f1++)
		{
			for(f2 = 0; f2 < x; f2++)
			{
				scanf("%d",&map[f1][f2]);
				temp[f1][f2] = 0;
			}
		}
		//最上のスタート地点設定
		for(f1 = 0; f1 < x; f1++)
		{
			if(map[0][f1] != 1)
			{
				temp[0][f1] = 1;
				sum++;
			}
		}
		//探索
		if(y >= 2)
		{
			sum = 0;
			for(f1 = 0; f1 < y - 1; f1++)
			{
				for(f2 = 0; f2 < x; f2++)
				{
					if(map[f1][f2] == 0 && temp[f1][f2] > 0)
					{
						for(f3 = 0; f3 < 3; f3++)
						{
							//移動
							px = f2 + dx[f3];
							py = f1 + dy[f3];
							//範囲内か
							if(px >= 0 && px < x)
							{
								//同じｘ座標からのジャンプ台
								if(f3 == 1 && py <= y - 1){
									//ｙ軸2つ先へ
									while(py < y - 1 && map[py][px] == 2)
										py += 2;
								}
								//着地した場所がゴール地点のｙ座標と同じで障害物にぶつかってないか
								//ゴール地点のｙ座標を超えたか
								if(py > y - 1 || py == y - 1 && map[py][px] != 1)
									sum += temp[f1][f2];
								//超えてないが、障害物がない地点に着地したか
								else if(map[py][px] == 0)
									temp[py][px] += temp[f1][f2];
							}
						}
					}
				}
			}
		}
		//出力
		printf("%d\n",sum);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:23: error: 'new' undeclared (first use in this function)
   12 |                 map = new int *[y];
      |                       ^~~
main.c:12:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:26: error: expected ';' before 'int'
   12 |                 map = new int *[y];
      |                          ^~~~
      |                          ;
main.c:13:27: error: expected ';' before 'int'
   13 |                 temp = new int *[y];
      |                           ^~~~
      |                           ;
main.c:19:38: error: expected ';' before 'int'
   19 |                         map[f1] = new int [x];
      |                                      ^~~~
      |                                      ;
main.c:20:39: error: expected ';' before 'int'
   20 |                         temp[f1] = new int [x];
      |                                       ^~~~
      |                                       ;
Language: C++

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

int maps[20][20];
int course[20][20];
int X, Y;

void out();
int way(int y, int x){
  else if(course[y][x] > 0) return course[y][x];
  else if(maps[y][x] == 1) return 0;
  else if(y >= Y) return 1;
  else if(maps[y][x] == 2 && maps[y + 2][x] != 1) return course[y][x] = way(y + 2, x);
  else{
    int SUM = 0;
    for(int i = 0; i < 3; i++){
      int ny = y + 1;
      int nx = x - 1 + i;
      if(maps[ny][nx] != 1 && 1 <= nx && nx <= X){
	int flug = 1;
	if(i != 1 && maps[ny][nx] == 2) flug = 0;
	if(flug) SUM += way(ny, nx);
      }
    }
    return course[y][x] = SUM;
  }
} 

int main(){
  while(1){
    cin >> X >> Y;
    if(X == 0 && Y == 0) break;
    for(int i = 1; i <= Y; i++){
      for(int j = 1; j <= X; j++){
	cin >> maps[i][j];
	course[i][j] = 0;
      }
    }
    int cnt = 0;
    for(int i = 1; i <= X; i++){
      if(maps[0][i] != 1) cnt += way(1, i);
    }
    cout << cnt << endl;
  }
}

Compiler output:
a.cc: In function 'int way(int, int)':
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else if(course[y][x] > 0) return course[y][x];
      |   ^~~~
Language: C++

#include<algorithm>
using namespace std;

int maps[20][20];
int course[20][20];
int X, Y;

int way(int y, int x){
  if(course[y][x] > 0) return course[y][x];
  else if(maps[y][x] == 1) return 0;
  else if(y >= Y) return 1;
  else if(maps[y][x] == 2 && maps[y + 2][x] != 1) return course[y][x] = way(y + 2, x);
  else{
    int SUM = 0;
    for(int i = 0; i < 3; i++){
      int ny = y + 1;
      int nx = x - 1 + i;
      if(maps[ny][nx] != 1 && 1 <= nx && nx <= X){
	int flug = 1;
	if(i != 1 && maps[ny][nx] == 2) flug = 0;
	if(flug) SUM += way(ny, nx);
      }
    }
    return course[y][x] = SUM;
  }
} 

int main(){
  while(1){
    cin >> X >> Y;
    if(X == 0 && Y == 0) break;
    for(int i = 1; i <= Y; i++){
      for(int j = 1; j <= X; j++){
	cin >> maps[i][j];
	course[i][j] = 0;
      }
    }
    int cnt = 0;
    for(int i = 1; i <= X; i++){
      if(maps[0][i] != 1) cnt += way(1, i);
    }
    cout << cnt << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'cin' was not declared in this scope
   30 |     cin >> X >> Y;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<algorithm>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:42:5: error: 'cout' was not declared in this scope
   42 |     cout << cnt << endl;
      |     ^~~~
a.cc:42:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:42:20: error: 'endl' was not declared in this scope
   42 |     cout << cnt << endl;
      |                    ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<algorithm>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include<iostream>
??
using namespace std;
??
int main() {
????????int x, y;
????????int skimap[15][15] = {};//x = j y = i
????????int dp[15][15] = {};//x = j y = i
????????while (cin >> x >> y, x * y) {//
????????????????int flyover = 0;
????????????????for (int i = 0; i < y; i++) {
????????????????????????for (int j = 0; j < x; j++) {
????????????????????????????????cin >> skimap[i][j];
????????????????????????}
????????????????}
????????????????for(int i = 0; i < x;i++){
????????????????????????if (skimap[0][i] == 0)dp[0][i] = 1;
????????????????}
????????????????for (int i = 0; i < y - 1; i++) {
????????????????????????for (int j = 0; j < x; j++) {
????????????????????????????????if (skimap[i][j] == 0) {
????????????????????????????????????????if (j - 1 >= 0) {
????????????????????????????????????????????????if (skimap[i + 1][j - 1] == 0) {
????????????????????????????????????????????????????????dp[i + 1][j - 1] += dp[i][j];
????????????????????????????????????????????????}
????????????????????????????????????????}
????????????????????????????????????????if (skimap[i + 1][j] != 1)dp[i + 1][j] += dp[i][j];
????????????????????????????????????????if (j + 1 < x) {
????????????????????????????????????????????????if (skimap[i + 1][j + 1] == 0) {
????????????????????????????????????????????????????????dp[i + 1][j + 1] += dp[i][j];
????????????????????????????????????????????????}
????????????????????????????????????????}
????????????????????????????????}
????????????????????????????????else if (skimap[i][j] == 1) {
????????????????????????????????????????continue;
????????????????????????????????}else {
????????????????????????????????????????if (i + 2 < y) {
????????????????????????????????????????????????dp[i + 2][j] = dp[i][j];
????????????????????????????????????????}else {
????????????????????????????????????????????????flyover += dp[i][j];
????????????????????????????????????????}
????????????????????????????????}
????????????????????????}
????????????????}
????????????????int sum = flyover;
????????????????for (int i = 0; i < x; i++) {
????????????????????????sum += dp[y - 1][i];
????????????????}
????????????????cout << sum << endl;
        for (int i = 0; i < y; i++){
            for(int j = 0; j < x; j++){
                dp[i][j] = 0;
                skimap[i][j] = 0;
            }
        } 
????????}
????????return 0;
}

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

#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<algorithm>

using namespace std;

int main(){
	int n,m;
	int masu[17][17];
	int ura[17][17];
	while(1){
		scanf("%d%d",&n,&m);
		if(n==0 && m==0){
			break;
		}
		for(int i=0;i<17;i++){
			for(int j=0;j<17;j++){
				masu[i][j]=0;
				ura[i][j]=0;
			}
		}
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++){
				scanf("%d",&ura[i][j]);
			}
		}
		for(int i=1;i<=n;i++){
			switch(ura[1][i]){
				case 0:masu[1][i]+=1;break;
				case 1:masu[1][i]+=0;break;
				case 2:if(ura[2][i]==0){masu[2][i]+=1};break;
			}
		}
		for(int i=1;i<n;i++){
			for(int j=1;j<=m;j++){
				if(ura[i][j]==0){
					if(ura[i+1][j-1]==0){
						masu[i+1][j-1]+=masu[i][j];
					}
					if(ura[i+1][j]!=1){
						masu[i+1][j]+=masu[i][j];
					}
					if(ura[i+1][j+1]==0){
						masu[i+1][j+1]+=masu[i][j];
					}
				}else if(ura[i][j]==2){
					if(ura[i+2][j]!=1){
						masu[i+2][j]+=masu[i][j];
					}
				}
			}
		}
		
		int cont=0;
		for(int i=n;i<=n+1;i++){
			for(int j=1;j<=m;j++){
				cont+=masu[i][j];
			}
		}
		printf("%d\n",cont);
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:70: error: expected ';' before '}' token
   34 |                                 case 2:if(ura[2][i]==0){masu[2][i]+=1};break;
      |                                                                      ^
      |                                                                      ;
Language: C++

#include<iostream>

using namespace std;

int main(){
	int n,m;
	int masu[17][17];
	int ura[17][17];
	cin>>n>>m;
	for(int i=0;i<17;i++){
		for(int j=0;j<17;j++){
			masu[i][j]=ura[i][j]=0;
		}
	}
	
	for(int i=0;i<n;i++){
		for(int j=1;j<=m;j++){
			cin>>masu[i][j];
		}
	}
	
	for(int j=1;j<=m;j++){
		if(masu[i][j]!=1){
		ura[0][j]=1;
		}
	}
	
	
	for(int i=0;i<n-1;i++){
		for(int j=1;j<=m;j++){
			if(masu[i][j]==0){
				if(masu[i+1][j-1]==0){
					ura[i+1][j-1]+=ura[i][j];
				}
				if(masu[i+1][j]!=1){
					ura[i+1][j]+=ura[i][j];
				}
				if(masu[i+1][j+1]==0){
					ura[i+1][j+1]+=ura[i][j];
				}
			}
			
			if(masu[i][j]==2){
				if(masu[i+2][j]!=1){
					ura[i+2][j]+=ura[i][j];
				}
			}
		}
	}
	int cont=0;
	for(int i=1;i<=m;i++){
		cont+=ura[n][i]+ura[n-1][i];
	}
	
	/*
	
	for(int i=0;i<17;i++){
		for(int j=0;j<17;j++){
			printf("%2d ",ura[i][j]);
		}
		puts("");
	}*/
	printf("%d\n",cont);
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: 'i' was not declared in this scope
   23 |                 if(masu[i][j]!=1){
      |                         ^
Language: C++

5 5
0 0 0 0 1
2 1 0 2 0
1 0 0 1 1
0 2 1 2 0
0 1 0 0 0
5 5
0 0 1 0 0
2 1 0 2 0
1 0 0 1 1
0 2 1 2 0
0 1 0 0 0
15 15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 5 5
      | ^
Language: C++

#include<iostream>
using namespace std;

int DP[17][17];
int field[17][17];
int x,y;

int main(){
	while(true){
		cin >> x >> y;
		if(!x && !y)
			return 0;
		
		for(int i=1; i<=y; i++)
			for(int k=1; k<=x; k++)
				cin >> field[i][k];
		for(int i=1; i<=x; i++)
			field[y+1][i] = 0;
		
		for(int i=1; i<=y+1; i++)
			for(int k=0; k<=x+1; k++){
				DP[i][k]=0;
				if(i==1 && k>0 && k<=x)
					if(field[i][k] == 0)
						DP[i][k] = 1;
			}
		
		for(int i=2; i<=y; i++){
			for(int k=1; k<=x; k++){
				if(field[i][k] == 0)
					DP[i][k] += DP[i-1][k-1] + DP[i-1][k] + DP[i-1][k+1];
				else if(field[i][k] == 2)
					int n = i+2;
					while(true){
						if(field[n][k] == 0){
							DP[n][k] += DP[i-1][k];
							break;
						}else if(field[n][k] == 1)
							break;
						else
							n+=2;
					}
				}
			}
		}
		
		int ans=0;
		for(int i=y; i<=y+1; i++)
			for(int k=1; k<=x; k++)
				ans += DP[i][k];
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:58: error: 'n' was not declared in this scope
   35 |                                                 if(field[n][k] == 0){
      |                                                          ^
a.cc: At global scope:
a.cc:53:1: error: expected declaration before '}' token
   53 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

void solve(int f[20][20] , w , h ){
    int dp[20][20] = {0};
    for(int x=1 ; x <= w ; x++ ){
        dp[1][x] = 1;
    }

    for(int y=1 ; y <= h-1 ; y++ ){
        for(int x=1 ; x <= w ; x++ ){
            if( f[y][x] == 0 ){
                if( f[y+1][x-1] == 0 ) dp[y+1][x-1] += dp[y][x];
                if( f[y+1][x]   == 0 ) dp[y+1][x]   += dp[y][x];
                if( f[y+1][x+1] == 0 ) dp[y+1][x+1] += dp[y][x];
                if( f[y+1][x]   == 2 ) dp[y+1][x]   += dp[y][x];
            }else if( f[y][x] == 2 ){
                if( f[y+2][x] == 0 || f[y+2][x] == 2 ){
                    dp[y+2][x] += dp[y][x];
                }
            }
        }
    }
    int ans = 0;
    for(int x=1 ; x <= w ; x++ ){
        ans += dp[h][x] + dp[h+1][x];
    }
    return ans;
}

int main(){
    int w,h;

    while( cin >> w >> h , w||h ){
        int f[20][20] = {0};
        for(int y=1 ; y <= h ; y++ ){
            for(int x=1 ; x <= w ; x++ ){
                cin >> f[y][x];
            }
        }

        int ans = solve( f , w , h );
        cout << ans << endl;
    }
}

Compiler output:
a.cc:4:28: error: 'w' has not been declared
    4 | void solve(int f[20][20] , w , h ){
      |                            ^
a.cc:4:32: error: 'h' has not been declared
    4 | void solve(int f[20][20] , w , h ){
      |                                ^
a.cc: In function 'void solve(int (*)[20], int, int)':
a.cc:6:24: error: 'w' was not declared in this scope
    6 |     for(int x=1 ; x <= w ; x++ ){
      |                        ^
a.cc:10:24: error: 'h' was not declared in this scope
   10 |     for(int y=1 ; y <= h-1 ; y++ ){
      |                        ^
a.cc:11:28: error: 'w' was not declared in this scope
   11 |         for(int x=1 ; x <= w ; x++ ){
      |                            ^
a.cc:25:24: error: 'w' was not declared in this scope
   25 |     for(int x=1 ; x <= w ; x++ ){
      |                        ^
a.cc:26:19: error: 'h' was not declared in this scope
   26 |         ans += dp[h][x] + dp[h+1][x];
      |                   ^
a.cc:28:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   28 |     return ans;
      |            ^~~
a.cc: In function 'int main()':
a.cc:42:24: error: void value not ignored as it ought to be
   42 |         int ans = solve( f , w , h );
      |                   ~~~~~^~~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int w,h;
int s[40][40];
int dp[40][40];
int dx[]={-1,0,1};
int ret(int y,int x){
	if(y>=h-1){
		if(h-1==y&&s[y][x]==1)
		return 0;
		return 1;
	}
	if(dp[y][x]!=-1)
	return dp[y][x];
	if(s[y][x]==1)
		return dp[y][x]=0;
	if(s[y][x]==2){
		return dp[y][x]=ret(y+2,x);
	}
	int ans=0;
	for(int i=0;i<3;i++){
		int nx=dx[i]+x;
		if(nx>=w||nx<0)
			continue;
		
		if(s[y+1][nx]==0){
			ans+=ret(y+1,nx);
		}else if(s[y+1][nx]==2){
			if(i!=1)
				continue;
			ans+=ret(y+1,nx);
		}
	}
	return dp[y][x]=ans;
}
int main(){
	while(cin>>w>>h,w||h){
		memset(dp,-1,sizeof(dp));
		for(int i=0;i<h;i++)
		for(int j=0;j<w;j++)
		cin>>s[i][j];
		int ans=0;
		for(int i=0;i<w;i++){
			//if(s[0][i]==0)
				ans+=ret(0,i);
		}
		cout<<dp[3][0]<<endl;
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:17: error: 'memset' was not declared in this scope
   38 |                 memset(dp,-1,sizeof(dp));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include<iostream>
#include<cstdio>

using namespace std;

int x,y;
int fie[20][20];
long long int dp[20][20];
long long int ans=0;

int main(void){
	while(1){
		scanf("%d%d",&x,&y);
		if(x==0 && y==0)break;
		memset(fie,0,sizeof(fie));
		memset(dp,0,sizeof(dp));
		ans=0;

		for(int i=0;i<y;i++){
			for(int j=0;j<x;j++){
				scanf("%d",&fie[j][i]);
			}
		}
		for(int i=0;i<x;i++){
			if(fie[i][0]==0)dp[i][0]=1;
			if(fie[i][0]==2)dp[i][2]=1;
		}
		for(int i=0;i<y;i++){
			for(int j=0;j<x;j++){
				if(fie[j][i]==0){
					for(int k=j-1;k<=j+1;k++){
						if(k>=0 && k<x){
							if(fie[k][i+1]==0){
								dp[k][i+1]+=dp[j][i];
							}
							if(fie[k][i+1]==2 && k==j){
								dp[k][i+1]+=dp[j][i];
							}
						}
					}
				}
				if(fie[j][i]==2){
					dp[j][i+2]+=dp[j][i];
				}
			}
		}
		for(int i=0;i<y;i++){
				for(int j=0;j<x;j++){
					if(i>=y-2 && fie[j][i]==2)ans+=dp[j][i];
					if(i==y-1 && fie[j][i]==0)ans+=dp[j][i];
			}
		}
		printf("%lld\n",ans);
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
   15 |                 memset(fie,0,sizeof(fie));
      |                 ^~~~~~
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 |
Language: C++

#include<iostream>

using namespace std;

int X, Y;
int status[17][18];	//status[x][y]
int memo[17][18];
int i, j;
int count;

int check(int x, int y);

int main(){

	while(1){

		count = 0;

		cin >> X >> Y;

		if(X == 0 && Y == 0){break;}

		else{

			//フィールドの入力
			//i行目について( 1 <= i <= Y+2 )
			for(i = 1; i <= Y+2; i++){
				//j文字目について( 0 <= j <= X+1)
				for(j = 0; j <= X+1; j++){

					//Y+1, Y+2列目に移動できるようにする。
					if(i > Y){
						status[j][i] = 0;
					}
					//両サイドには障害物を敷き詰める。
					else if(j == 0 || j == X+1){
						status[j][i] = 1;
					}
					else{
						cin >> status[j][i];
					}
				}
			}

/*//フィールド出力
			for(i = 1; i <= Y+2; i++){
				for(j = 0; j <= X+1; j++){
					cout << status[j][i];
				}
				cout << endl;
			}
*/

			for(i = 1; i <= X; i++){
				memset(memo, 0, sizeof(memo));
				count += check(i, 1);
			}

			cout << count << endl;
		}
	}

	return 0;
}


int  check(int x, int y){

//	cout << "x:" << x << "y:" << y << " : "<< status[x][y] << endl;

	//関数のメモが残っているならメモを返す
	if(memo[x][y] > 0){return memo[x][y];}

	//status[x][y]の次でゴール
	if(status[x][y] == 1){return 0;}
	if(status[x][y] == 0 && y == Y){return 1;}
	if(status[x][y] == 2 && (y == Y-1 || y == Y)){return 1;}

	//それ以外
	else{
		//ジャンプ台
		if(status[x][y] == 2){
			memo[x][y] += check(x, y+2);
		}
		//平地
		else{
			if(status[x-1][y+1] == 0){
				memo[x][y] += check(x-1, y+1);
			}
			if(status[x][y+1] == 0 || status[x][y+1] == 2){
				memo[x][y] += check(x, y+1);
			}
			if(status[x+1][y+1] == 0){
				memo[x][y] += check(x+1, y+1);
			}
		}

		return memo[x][y];
	}
}

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

#include <iostream>
using namespace std;

int w,h;
int map[16][16];
int dp[16][16][4][2];

int rec(int x,int y,int state,bool str){
    if(state == 1 || x < 0 || x >= w) return 0;
    if(state == 2 && !str) return 0;
    if(y >= h-1) return 1;
    if(dp[y][x][state][str] != -1) return dp[y][x][state][str];
    int res;
    if(state == 2) res = rec(x,y+2,map[y+2][x],true);
    else res = (rec(x-1,y+1,map[y+1][x-1],false) + rec(x,y+1,map[y+1][x],true) + rec(x+1,y+1,map[y+1][x+1],false));
    return dp[y][x][state][str] = res;
}

int main(){
    while(cin >> w >> h,w||h){
        memset(dp,-1,sizeof(dp));
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++) cin >> map[i][j];
        }
        int d = 0;
        for(int i=0;i<w;i++) d += rec(i,0,map[0][i],true);
        cout << d << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'memset' was not declared in this scope
   21 |         memset(dp,-1,sizeof(dp));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C

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

#define PIE atan(1.0)*4

typedef struct nd{
	int id;
	//
	int x, y;
	int r;
	int v;
	//
	double polar_r;
	double polar_t;
	//
	int state;	// 0:接近中，1:撃破, 2:到達
	struct nd *next;
	struct nd *prev;
	bool dummy;
} node;

void initList(node **top, int num) {
	// 極座標変換
	for (int i = 0; i < num; i++) {
		top[i]->polar_r = sqrt((double)(top[i]->x*top[i]->x + top[i]->y*top[i]->y));
		top[i]->polar_t = acos((double)top[i]->x / top[i]->polar_r);
		if (top[i]->y < 0)
			top[i]->polar_t = 2*PIE-top[i]->polar_t;
		top[i]->prev = i!=0 ? top[i - 1] : NULL;
		top[i]->next = i!=num-1 ? top[i + 1] : NULL;
		top[i]->dummy = false;
	}
}

node *removeNode(node *target) {
	node *next = target->next;
	target->next->prev = target->prev;
	target->prev->next = target->next;
	free(target);
	return next;
}

void removeNodes(node *begin) {
	node *temp = begin->next;
	while (temp->next != NULL) {
		if (temp->state != 0)
			temp = removeNode(temp);
		else
			temp = temp->next;
	}
}

int main(int argc, char* argv[]) {

	while (true) {
		// データ読み込み
		int invaridR, ufoNum;
		scanf_s("%d %d", &invaridR, &ufoNum);
		if (invaridR == 0 && ufoNum == 0) break;
		node **ufos = (node**)malloc(sizeof(node*)*ufoNum);
		for (int i = 0; i < ufoNum; i++) {
			ufos[i] = (node*)malloc(sizeof(node));
			ufos[i]->id = i;
			scanf_s("%d %d %d %d", &(ufos[i]->x), &(ufos[i]->y), &(ufos[i]->r), &(ufos[i]->v));
			ufos[i]->next = ufos[i]->prev = NULL;
			ufos[i]->state = 0;
		}
		initList(ufos, ufoNum);
		node *begin = (node*)malloc(sizeof(node));
		begin->dummy = true;
		begin->id = -1;
		begin->prev = NULL;
		begin->next = ufos[0];
		ufos[0]->prev = begin;
		node *end = (node*)malloc(sizeof(node));
		end->dummy = true;
		end->id = -2;
		end->next = NULL;
		end->prev = ufos[ufoNum - 1];
		ufos[ufoNum - 1]->next = end;

		// 計算
		int t = 0;
		int count = 0;
		while (begin->next != end) {
			// 位置＆時刻更新
			t++;
			for (int i = 0; i < ufoNum; i++) {
				ufos[i]->polar_r -= ufos[i]->v;
			}
			// 照射方向決定
			double minR = 1500;
			double fireT = 0;
			for (node *temp = begin->next; temp != end; temp = temp->next) {
				if (temp->polar_r < minR && temp->polar_r>invaridR) {
					minR = temp->polar_r;
					fireT = temp->polar_t;
				}
			}
			// 照射
			for (node *temp = begin->next; temp != end; temp = temp->next) {
				double dt = fireT - temp->polar_t;
				if (dt > 2 * PIE) dt -= 2 * PIE;
				if (dt < 0) dt += 2 * PIE;
				if (temp->polar_r < invaridR) {
					// 到達
					temp->state = 2;
					count++;
				}
				else if (fabs(temp->polar_r*sin(dt)) < temp->r){
					// 撃破
					temp->state = 1;
				}
			}
			// 不要ufo削除
			removeNodes(begin);
		}

		fprintf(stdout, "%d\n", count);
	}
}

Compiler output:
main.c: In function 'main':
main.c:60:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   60 |                 scanf_s("%d %d", &invaridR, &ufoNum);
      |                 ^~~~~~~
      |                 scanf