結果

問題 No.794 チーム戦 (2)
ユーザー keymoonkeymoon
提出日時 2019-02-22 22:26:24
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,472 bytes
コンパイル時間 1,022 ms
コンパイル使用メモリ 112,740 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-05-04 03:11:01
合計ジャッジ時間 6,005 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
25,252 KB
testcase_01 AC 30 ms
27,500 KB
testcase_02 AC 29 ms
27,384 KB
testcase_03 AC 28 ms
25,124 KB
testcase_04 AC 30 ms
25,456 KB
testcase_05 AC 31 ms
25,260 KB
testcase_06 AC 28 ms
25,380 KB
testcase_07 AC 29 ms
27,292 KB
testcase_08 AC 31 ms
27,292 KB
testcase_09 AC 30 ms
25,332 KB
testcase_10 AC 30 ms
27,252 KB
testcase_11 AC 29 ms
25,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 230 ms
51,840 KB
testcase_15 AC 231 ms
50,316 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 212 ms
50,308 KB
testcase_19 AC 210 ms
50,048 KB
testcase_20 AC 226 ms
50,060 KB
testcase_21 AC 213 ms
51,840 KB
testcase_22 AC 142 ms
44,280 KB
testcase_23 AC 138 ms
41,120 KB
testcase_24 AC 106 ms
31,332 KB
testcase_25 AC 92 ms
32,392 KB
testcase_26 AC 97 ms
32,976 KB
testcase_27 AC 169 ms
41,200 KB
testcase_28 AC 177 ms
41,200 KB
testcase_29 WA -
testcase_30 AC 161 ms
45,428 KB
testcase_31 AC 164 ms
41,208 KB
testcase_32 AC 160 ms
41,204 KB
testcase_33 AC 167 ms
39,024 KB
testcase_34 AC 171 ms
41,080 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.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

class P
{
    static void Main()
    {
        var nk = Console.ReadLine().Split().Select(int.Parse).ToList();
        var a = Console.ReadLine().Split().Select(int.Parse).OrderByDescending(x => x).ToList();
        //なんやこれ DP?
        long res = 1;
        for (int i = 0; i < a.Count / 2; i++)
        {
            int pairMax = nk[1] - a[i];
            int valid = a.Count - 1;
            int invalid = i;
            if (pairMax < a[valid])
            {
                res *= 0;
                break;
            }
            if (a[invalid] <= pairMax)
            {
                res *= a.Count - i * 2 - 1;//自分を除外しないといけないため
                res %= 1000000007;
                continue;
            }

            while (valid - invalid > 1)
            {
                var mid = (valid + invalid) / 2;
                if (a[mid] <= pairMax) valid = mid;
                else invalid = mid;
            }
            if (a.Count - valid <= i)
            {
                res *= 0;
                return;
            }
            res *= (a.Count - valid - i);
            res %= 1000000007;
        }
        Console.WriteLine(res);
    }
}
0