結果

問題 No.2615 ペアの作り方
ユーザー heno239heno239
提出日時 2024-02-02 17:49:38
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 723 ms / 2,000 ms
コード長 1,122 bytes
コンパイル時間 6,829 ms
コンパイル使用メモリ 158,496 KB
実行使用メモリ 234,460 KB
最終ジャッジ日時 2024-02-02 17:49:52
合計ジャッジ時間 13,600 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
33,828 KB
testcase_01 AC 77 ms
33,828 KB
testcase_02 AC 76 ms
33,828 KB
testcase_03 AC 76 ms
33,828 KB
testcase_04 AC 76 ms
33,828 KB
testcase_05 AC 76 ms
33,828 KB
testcase_06 AC 75 ms
33,828 KB
testcase_07 AC 77 ms
33,828 KB
testcase_08 AC 76 ms
33,828 KB
testcase_09 AC 80 ms
35,236 KB
testcase_10 AC 81 ms
35,108 KB
testcase_11 AC 83 ms
35,108 KB
testcase_12 AC 81 ms
35,108 KB
testcase_13 AC 81 ms
35,108 KB
testcase_14 AC 81 ms
35,236 KB
testcase_15 AC 723 ms
86,872 KB
testcase_16 AC 723 ms
86,872 KB
testcase_17 AC 722 ms
86,876 KB
testcase_18 AC 721 ms
86,872 KB
testcase_19 AC 716 ms
86,876 KB
testcase_20 AC 715 ms
234,460 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (92 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

// See https://aka.ms/new-console-template for more information
using System.Collections;
using System.Runtime.InteropServices;

internal class Program
{
    public static void Main(string[] args)
    {
        const int mod = 998244353;
        long ans = 1;
        int n = int.Parse(Console.ReadLine());
        var x=Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var y=Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        List<Tuple<int, int>> xy = new List<Tuple<int, int>>(2*n);
        for (int i = 0; i < n; i++)
        {
            xy.Add(Tuple.Create(x[i],0));
            xy.Add(Tuple.Create(y[i],1));
        }
        xy.Sort();
        var c = mkar(2, 0);
        for (int i = 0; i < n; i++)
        {
            c[xy[i].Item2]++;
        }

        for (int i = 1; i <= c[0]; i++) ans = ans * i % mod;
        for (int i = 1; i <= c[1]; i++) ans = ans * i % mod;
        Console.WriteLine(ans);
    }

    public static List<int> mkar(int n, int val)
    {
        List<int> res = new List<int>(n);
        for(int i=0;i<n;i++)res.Add(val);
        return res;
    }
}
0