結果

問題 No.1280 Beyond C
ユーザー keymoonkeymoon
提出日時 2021-01-18 11:19:08
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 267 ms / 2,000 ms
コード長 1,099 bytes
コンパイル時間 5,474 ms
コンパイル使用メモリ 106,060 KB
実行使用メモリ 49,708 KB
最終ジャッジ日時 2023-08-20 18:54:11
合計ジャッジ時間 8,541 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
23,680 KB
testcase_01 AC 69 ms
24,024 KB
testcase_02 AC 70 ms
25,680 KB
testcase_03 AC 67 ms
23,872 KB
testcase_04 AC 67 ms
22,000 KB
testcase_05 AC 69 ms
23,828 KB
testcase_06 AC 69 ms
25,792 KB
testcase_07 AC 70 ms
23,780 KB
testcase_08 AC 69 ms
23,824 KB
testcase_09 AC 70 ms
23,916 KB
testcase_10 AC 70 ms
25,792 KB
testcase_11 AC 78 ms
24,076 KB
testcase_12 AC 77 ms
24,128 KB
testcase_13 AC 80 ms
26,020 KB
testcase_14 AC 80 ms
24,036 KB
testcase_15 AC 174 ms
40,412 KB
testcase_16 AC 151 ms
33,220 KB
testcase_17 AC 174 ms
42,772 KB
testcase_18 AC 232 ms
47,216 KB
testcase_19 AC 235 ms
46,968 KB
testcase_20 AC 266 ms
49,624 KB
testcase_21 AC 267 ms
45,580 KB
testcase_22 AC 266 ms
49,708 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var nmc = Console.ReadLine().Split().Select(long.Parse).ToArray();
        var c = nmc[2]; 
        var a = Console.ReadLine().Split().Select(long.Parse).OrderByDescending(x => x).ToArray();
        var b = Console.ReadLine().Split().Select(long.Parse).OrderByDescending(x => x).ToArray();
        double res = 0;
        for (int i = 0; i < a.Length; i++)
        {
            int valid = -1;
            int invalid = b.Length;
            while ((invalid - valid) > 1)
            {
                var mid = (invalid + valid) / 2;
                if (c < a[i] * b[mid]) valid = mid;
                else invalid = mid;
            }
            res += (double)invalid / b.Length;
        }
        res /= a.Length;
        Console.WriteLine(res);
    }
}
0