結果

問題 No.1280 Beyond C
ユーザー tentententen
提出日時 2020-11-09 09:23:59
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 769 bytes
コンパイル時間 2,118 ms
コンパイル使用メモリ 71,572 KB
実行使用メモリ 65,336 KB
最終ジャッジ日時 2023-09-29 21:58:01
合計ジャッジ時間 11,033 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,004 KB
testcase_01 AC 119 ms
56,144 KB
testcase_02 AC 120 ms
55,816 KB
testcase_03 AC 120 ms
55,780 KB
testcase_04 AC 120 ms
56,000 KB
testcase_05 AC 117 ms
56,120 KB
testcase_06 AC 119 ms
56,444 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 157 ms
56,296 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 748 ms
65,336 KB
testcase_19 AC 763 ms
65,304 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

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();
        }
        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