結果

問題 No.1280 Beyond C
ユーザー ks2mks2m
提出日時 2020-11-06 21:35:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 404 ms / 2,000 ms
コード長 960 bytes
コンパイル時間 2,015 ms
コンパイル使用メモリ 74,096 KB
実行使用メモリ 67,080 KB
最終ジャッジ日時 2023-09-29 18:20:19
合計ジャッジ時間 6,534 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,444 KB
testcase_01 AC 42 ms
49,456 KB
testcase_02 AC 43 ms
49,964 KB
testcase_03 AC 41 ms
49,400 KB
testcase_04 AC 41 ms
49,968 KB
testcase_05 AC 41 ms
49,292 KB
testcase_06 AC 42 ms
49,324 KB
testcase_07 AC 42 ms
49,356 KB
testcase_08 AC 41 ms
49,452 KB
testcase_09 AC 42 ms
49,204 KB
testcase_10 AC 43 ms
49,956 KB
testcase_11 AC 54 ms
51,320 KB
testcase_12 AC 44 ms
49,340 KB
testcase_13 AC 52 ms
49,508 KB
testcase_14 AC 52 ms
49,760 KB
testcase_15 AC 307 ms
64,280 KB
testcase_16 AC 259 ms
60,312 KB
testcase_17 AC 288 ms
63,912 KB
testcase_18 AC 346 ms
65,892 KB
testcase_19 AC 317 ms
66,432 KB
testcase_20 AC 404 ms
65,976 KB
testcase_21 AC 404 ms
67,080 KB
testcase_22 AC 400 ms
66,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int n = Integer.parseInt(sa[0]);
		int m = Integer.parseInt(sa[1]);
		long c = Long.parseLong(sa[2]);
		sa = br.readLine().split(" ");
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sa[i]);
		}
		sa = br.readLine().split(" ");
		double[] b = new double[m];
		for (int i = 0; i < m; i++) {
			b[i] = Integer.parseInt(sa[i]);
		}
		br.close();

		long total = (long) n * m;
		Arrays.sort(a);
		Arrays.sort(b);
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long val = c / a[i] + 1;
			int idx = Arrays.binarySearch(b, val - 0.5);
			if (idx < 0) idx = ~idx;
			sum += m - idx;
		}
		System.out.println((double) sum / total);
	}
}
0