結果

問題 No.2615 ペアの作り方
コンテスト
ユーザー startcpp
提出日時 2022-02-07 01:00:42
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 364 ms / 2,000 ms
+ 229µs
コード長 393 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 660 ms
コンパイル使用メモリ 21,464 KB
実行使用メモリ 37,896 KB
最終ジャッジ日時 2026-09-05 14:51:55
合計ジャッジ時間 5,445 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

pa = []
for i in range(n):
	pa.append((x[i], 0))
	pa.append((y[i], 1))
pa.sort()

cntx = 0
cnty = 0
for i in range(n):
	if pa[i][1] == 0:
		cntx += 1
	else:
		cnty += 1

mod = 998244353
ans = 1
for i in range(cntx):
	ans *= i + 1
	ans %= mod
	
for i in range(cnty):
	ans *= i + 1
	ans %= mod

print(ans)
0