标签:跳过 imp java color ret 问题 turn 数位 util
import java.util.Scanner; public class Main { static int n,m; static int[] a; static int ans=0; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); n = scanner.nextInt(); m = scanner.nextInt(); a = new int[m]; for (int i = 0; i < m; i++) { a[i]=scanner.nextInt(); } f(1,a,0); System.out.println(ans); } private static void f(int i, int[] a, int j) { if (j>n) { return; } if (j==n) { ans++; return ; } for (int j2 = 0; j2 < m; j2++) { if (j==a[j2]) { return ; } } f(i+2, a, j=i+2); f(i+1, a, j=i+1); } }
标签:跳过 imp java color ret 问题 turn 数位 util
原文地址:https://www.cnblogs.com/shiaguang/p/12371488.html