結果

問題 No.1280 Beyond C
ユーザー EvolMaxEvolMax
提出日時 2020-11-12 09:36:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 820 ms / 2,000 ms
コード長 796 bytes
コンパイル時間 2,014 ms
コンパイル使用メモリ 72,240 KB
実行使用メモリ 65,308 KB
最終ジャッジ日時 2023-09-30 01:08:00
合計ジャッジ時間 11,340 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,500 KB
testcase_01 AC 118 ms
55,768 KB
testcase_02 AC 117 ms
56,196 KB
testcase_03 AC 118 ms
56,244 KB
testcase_04 AC 118 ms
56,196 KB
testcase_05 AC 118 ms
55,996 KB
testcase_06 AC 119 ms
55,896 KB
testcase_07 AC 120 ms
55,928 KB
testcase_08 AC 120 ms
55,936 KB
testcase_09 AC 117 ms
56,292 KB
testcase_10 AC 119 ms
55,860 KB
testcase_11 AC 185 ms
57,864 KB
testcase_12 AC 168 ms
54,376 KB
testcase_13 AC 175 ms
56,376 KB
testcase_14 AC 190 ms
56,224 KB
testcase_15 AC 623 ms
60,832 KB
testcase_16 AC 567 ms
60,600 KB
testcase_17 AC 621 ms
61,944 KB
testcase_18 AC 732 ms
65,192 KB
testcase_19 AC 746 ms
65,216 KB
testcase_20 AC 792 ms
65,268 KB
testcase_21 AC 820 ms
65,308 KB
testcase_22 AC 788 ms
64,872 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 m = sc.nextInt();
        long c = sc.nextLong();
        int[] aArr = new int[n];
        for (int i = 0; i < n; i++) {
            aArr[i] = sc.nextInt();
        }
        Arrays.sort(aArr);
        int[] bArr = new int[m];
        for (int i = 0; i < m; i++) {
            bArr[i] = sc.nextInt();
        }
        Arrays.sort(bArr);
        long count = 0;
        int idx = m;
        for (int i = 0; i < n; i++) {
            while (idx > 0 && (long)aArr[i] * bArr[idx - 1] > c) {
                idx--;
            }
            count += m - idx;
        }
        System.out.println((double)count / n / m);
    }
}
0