本文共 1022 字,大约阅读时间需要 3 分钟。
import java.util.Scanner;public class Main{ public static void main(String a[]){ Scanner scan = new Scanner(System.in); while(scan.hasNext()){ //N:all stations'num //S:all seats'num //allNames:all stations'name //avaiSeat[..]: available seats'num ..now int N = scan.nextInt(),S = scan.nextInt(); int[] avaiSeats = new int[N]; String[] allNames = new String[N]; //input stations'name for(int i=0; i= bookSeat){ avaiSeats[j] -= bookSeat; for(int k=j+1; k 0) System.out.println(isOk[i] + " YES"); else System.out.println(isOk[i] + " NO"); } } }}
转载地址:http://hwljz.baihongyu.com/