結果

問題 No.2615 ペアの作り方
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2024-01-27 20:32:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 598 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 386 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 103,072 KB
最終ジャッジ日時 2024-01-27 20:32:54
合計ジャッジ時間 5,948 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
55,604 KB
testcase_01 AC 44 ms
55,604 KB
testcase_02 AC 46 ms
55,604 KB
testcase_03 AC 46 ms
55,604 KB
testcase_04 AC 44 ms
55,604 KB
testcase_05 AC 44 ms
55,604 KB
testcase_06 AC 47 ms
55,604 KB
testcase_07 AC 47 ms
55,604 KB
testcase_08 AC 45 ms
55,604 KB
testcase_09 AC 52 ms
65,712 KB
testcase_10 AC 55 ms
63,664 KB
testcase_11 AC 53 ms
63,664 KB
testcase_12 AC 51 ms
63,664 KB
testcase_13 AC 51 ms
63,664 KB
testcase_14 AC 50 ms
65,716 KB
testcase_15 AC 597 ms
103,072 KB
testcase_16 AC 579 ms
103,072 KB
testcase_17 AC 540 ms
103,020 KB
testcase_18 AC 569 ms
103,008 KB
testcase_19 AC 578 ms
103,068 KB
testcase_20 AC 598 ms
100,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

N = int(input())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
mod = 998244353

Z = [(x,1) for x in X] + [(y,0) for y in Y]
Z.sort()
n = sum(flg for x,flg in Z[:N])
m = N - n

ans = 1
for i in range(1,n+1):
    ans = (ans*i)%mod

for i in range(1,m+1):
    ans = (ans*i)%mod
print(ans)
0