結果

問題 No.2615 ペアの作り方
ユーザー eve__fuyukieve__fuyuki
提出日時 2024-01-29 16:39:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 197 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 128,652 KB
最終ジャッジ日時 2024-01-29 16:39:31
合計ジャッジ時間 4,408 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 34 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 35 ms
53,460 KB
testcase_06 AC 36 ms
53,460 KB
testcase_07 AC 36 ms
53,460 KB
testcase_08 AC 36 ms
53,460 KB
testcase_09 AC 41 ms
59,956 KB
testcase_10 AC 42 ms
59,956 KB
testcase_11 AC 42 ms
59,956 KB
testcase_12 AC 41 ms
59,956 KB
testcase_13 AC 41 ms
59,956 KB
testcase_14 AC 41 ms
59,956 KB
testcase_15 AC 181 ms
128,504 KB
testcase_16 AC 179 ms
128,528 KB
testcase_17 AC 170 ms
127,360 KB
testcase_18 AC 197 ms
128,652 KB
testcase_19 AC 171 ms
128,328 KB
testcase_20 AC 172 ms
128,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
fact = [1] * (n + 1)
MOD = 998244353
for i in range(1, n + 1):
    fact[i] = fact[i - 1] * i % MOD

x = list(map(int, input().split()))
y = list(map(int, input().split()))
xy = list(sorted(x + y))
is_low = {}
for i in range(2 * n):
    is_low[xy[i]] = i < n

cnt_x = 0
cnt_y = 0
for xx in x:
    cnt_x += is_low[xx]
print(fact[n - cnt_x] * fact[cnt_x] % MOD)
0