摘要:
这题就是dp的一般题目 public static int countWays(int x, int y){ if( x < 0 || y < 0) return -1; int[][] dp = new int[x][y]; ... 阅读全文
摘要:
注意:错误主要在溢出问题上。所以不设置int,而是long。 public static int countWays(int n){ if(n == 1) return 1; if(n == 2) return 2; if(n == 3) re... 阅读全文
摘要:
public static int[] getCloseNumber(int x){ int[] res = new int[2]; int i = 1; int num = oneNumber(x); while(res[0] == ... 阅读全文
摘要:
注意:仔细注意位置。 public static int[] renderPixel(int[] screen, int x, int y){ int[] ans = new int[screen.length ]; int[] tmp = new int[scre... 阅读全文