結果

問題 No.1280 Beyond C
ユーザー ks2mks2m
提出日時 2020-11-06 21:32:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 953 bytes
コンパイル時間 3,831 ms
コンパイル使用メモリ 74,668 KB
実行使用メモリ 68,912 KB
最終ジャッジ日時 2023-09-29 18:17:29
合計ジャッジ時間 6,766 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
47,464 KB
testcase_01 AC 42 ms
49,504 KB
testcase_02 AC 42 ms
49,180 KB
testcase_03 AC 42 ms
49,356 KB
testcase_04 AC 42 ms
49,168 KB
testcase_05 AC 42 ms
49,324 KB
testcase_06 AC 41 ms
49,360 KB
testcase_07 AC 41 ms
49,268 KB
testcase_08 AC 42 ms
49,372 KB
testcase_09 AC 42 ms
49,360 KB
testcase_10 AC 42 ms
49,364 KB
testcase_11 AC 55 ms
51,316 KB
testcase_12 AC 45 ms
49,528 KB
testcase_13 AC 53 ms
50,012 KB
testcase_14 AC 53 ms
49,556 KB
testcase_15 WA -
testcase_16 AC 267 ms
59,468 KB
testcase_17 WA -
testcase_18 AC 354 ms
67,576 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

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 = 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