http://hihocoder.com/contest/offers48/problems
题目1 : 折线中点
二分查找
package l481;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int[]xs=new int[n], ys=new int[n];
for(int i=0;i
题目2 : 最小先序遍历
递归
package l482;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int[]a=new int[n];
for(int i=0;ij) return new int[]{};
if(i==j) return new int[]{a[i]};
int min=a[i],idx=i;
for(int k=i+1;k<=j;k++) {
if(a[k]
题目3 : 假期计划
枚举+排列组合,WA,有大侠可以解释一下么?