Submission #74727


Source Code Expand

import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	static int[] box;
	static int[] nimotsu;
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	
		box = new int[3];
		nimotsu = new int[3];
		
		box[0] = scan.nextInt();
		box[1] = scan.nextInt();
		box[2] = scan.nextInt();
		nimotsu[0] = scan.nextInt();
		nimotsu[1] = scan.nextInt();
		nimotsu[2] = scan.nextInt();
		scan.close();

		int tmp;
		int best=0;
		tmp = calc(box[0],box[1],box[2],nimotsu[0],nimotsu[1],nimotsu[2]);
		if(tmp > best) best = tmp;
		tmp = calc(box[0],box[1],box[2],nimotsu[0],nimotsu[2],nimotsu[1]);
		if(tmp > best) best = tmp;
		tmp = calc(box[0],box[1],box[2],nimotsu[1],nimotsu[0],nimotsu[2]);
		if(tmp > best) best = tmp;
		tmp = calc(box[0],box[1],box[2],nimotsu[1],nimotsu[2],nimotsu[0]);
		if(tmp > best) best = tmp;
		tmp = calc(box[0],box[1],box[2],nimotsu[2],nimotsu[0],nimotsu[1]);
		if(tmp > best) best = tmp;
		tmp = calc(box[0],box[1],box[2],nimotsu[2],nimotsu[1],nimotsu[0]);
		if(tmp > best) best = tmp;

		System.out.println(best);
	}
	public static int calc(int bw,int bd,int bh,int nw,int nd,int nh){
/*		System.out.print(" w:"+(bw/nw));
		System.out.print(" d:"+(bd/nd));
		System.out.print(" h:"+(bh/nh));
		System.out.println(" ans:" + (bw/nw * bd/nd * bh/nh));*/
		return (int)(bw/nw) * (int)(bd/nd) * (int)(bh/nh);
	}

}

Submission Info

Submission Time
Task A - 梱包できるかな?
User marshkip
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 1429 Byte
Status AC
Exec Time 896 ms
Memory 20280 KiB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 35
Set Name Test Cases
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 01_rand_11.txt, 01_rand_12.txt, 01_rand_13.txt, 01_rand_14.txt, 01_rand_15.txt, 01_rand_16.txt, 01_rand_17.txt, 01_rand_18.txt, 01_rand_19.txt, 01_rand_20.txt, 01_rand_21.txt, 01_rand_22.txt, 01_rand_23.txt, 01_rand_24.txt, 01_rand_25.txt, 01_rand_26.txt, 01_rand_27.txt, 01_rand_28.txt, 01_rand_29.txt, 99_min.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 708 ms 20140 KiB
00_sample_02.txt AC 635 ms 20144 KiB
00_sample_03.txt AC 896 ms 20260 KiB
00_sample_04.txt AC 844 ms 20140 KiB
01_rand_00.txt AC 481 ms 20276 KiB
01_rand_01.txt AC 479 ms 20180 KiB
01_rand_02.txt AC 444 ms 20156 KiB
01_rand_03.txt AC 568 ms 20276 KiB
01_rand_04.txt AC 534 ms 20272 KiB
01_rand_05.txt AC 555 ms 20144 KiB
01_rand_06.txt AC 481 ms 20148 KiB
01_rand_07.txt AC 525 ms 20144 KiB
01_rand_08.txt AC 495 ms 20272 KiB
01_rand_09.txt AC 678 ms 20268 KiB
01_rand_10.txt AC 482 ms 20256 KiB
01_rand_11.txt AC 523 ms 20264 KiB
01_rand_12.txt AC 483 ms 20148 KiB
01_rand_13.txt AC 483 ms 20148 KiB
01_rand_14.txt AC 472 ms 20260 KiB
01_rand_15.txt AC 448 ms 20276 KiB
01_rand_16.txt AC 510 ms 20148 KiB
01_rand_17.txt AC 481 ms 20136 KiB
01_rand_18.txt AC 596 ms 20272 KiB
01_rand_19.txt AC 466 ms 20280 KiB
01_rand_20.txt AC 481 ms 20268 KiB
01_rand_21.txt AC 570 ms 20192 KiB
01_rand_22.txt AC 564 ms 20272 KiB
01_rand_23.txt AC 460 ms 20272 KiB
01_rand_24.txt AC 489 ms 20268 KiB
01_rand_25.txt AC 553 ms 20264 KiB
01_rand_26.txt AC 605 ms 20228 KiB
01_rand_27.txt AC 513 ms 20192 KiB
01_rand_28.txt AC 552 ms 20252 KiB
01_rand_29.txt AC 613 ms 20144 KiB
99_min.txt AC 493 ms 20184 KiB