結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー リチウムリチウム
提出日時 2014-11-16 23:47:29
言語 Java19
(openjdk 21)
結果
AC  
実行時間 1,074 ms / 5,000 ms
コード長 521 bytes
コンパイル時間 3,986 ms
コンパイル使用メモリ 71,720 KB
実行使用メモリ 64,940 KB
最終ジャッジ日時 2023-08-08 05:36:17
合計ジャッジ時間 30,671 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,063 ms
64,708 KB
testcase_01 AC 131 ms
55,612 KB
testcase_02 AC 718 ms
64,340 KB
testcase_03 AC 948 ms
64,940 KB
testcase_04 AC 982 ms
64,492 KB
testcase_05 AC 982 ms
64,600 KB
testcase_06 AC 997 ms
64,448 KB
testcase_07 AC 1,050 ms
64,372 KB
testcase_08 AC 1,042 ms
64,380 KB
testcase_09 AC 1,024 ms
64,036 KB
testcase_10 AC 968 ms
64,724 KB
testcase_11 AC 1,000 ms
64,296 KB
testcase_12 AC 946 ms
64,428 KB
testcase_13 AC 1,037 ms
64,572 KB
testcase_14 AC 1,033 ms
64,124 KB
testcase_15 AC 1,002 ms
64,476 KB
testcase_16 AC 1,030 ms
64,220 KB
testcase_17 AC 990 ms
64,848 KB
testcase_18 AC 968 ms
64,220 KB
testcase_19 AC 1,024 ms
64,064 KB
testcase_20 AC 1,037 ms
64,440 KB
testcase_21 AC 1,074 ms
64,224 KB
testcase_22 AC 958 ms
64,424 KB
testcase_23 AC 957 ms
64,936 KB
testcase_24 AC 124 ms
55,736 KB
testcase_25 AC 231 ms
59,080 KB
testcase_26 AC 201 ms
58,336 KB
testcase_27 AC 194 ms
55,832 KB
testcase_28 AC 476 ms
60,216 KB
testcase_29 AC 360 ms
59,892 KB
testcase_30 AC 233 ms
59,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		int L[]=new int[n];
		for(int i=0;i<n;i++){
			L[i]=sc.nextInt();
		}
		long k=sc.nextLong();
		
		double min=0;
		double max=1000000000;
		double mid=0;
		int p=0;
		while(p<200){
			mid=(min+max)/2;
			long sum=0;
			for(int i=0;i<n;i++){
				sum+=L[i]/mid;
			}
			if(sum>=k)min=mid;
			else max=mid;
			p++;
		}
		System.out.println(mid);
	}}
0