結果

問題 No.2615 ペアの作り方
ユーザー ああいいああいい
提出日時 2024-02-03 18:57:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 98,188 KB
最終ジャッジ日時 2024-02-03 18:58:02
合計ジャッジ時間 3,096 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
53,460 KB
testcase_01 AC 31 ms
53,460 KB
testcase_02 AC 34 ms
53,460 KB
testcase_03 AC 29 ms
53,460 KB
testcase_04 AC 29 ms
53,460 KB
testcase_05 AC 29 ms
53,460 KB
testcase_06 AC 29 ms
53,460 KB
testcase_07 AC 29 ms
53,460 KB
testcase_08 AC 31 ms
53,460 KB
testcase_09 AC 42 ms
59,444 KB
testcase_10 AC 35 ms
59,444 KB
testcase_11 AC 37 ms
59,444 KB
testcase_12 AC 35 ms
59,444 KB
testcase_13 AC 35 ms
59,444 KB
testcase_14 AC 34 ms
59,444 KB
testcase_15 AC 109 ms
97,404 KB
testcase_16 AC 108 ms
97,404 KB
testcase_17 AC 106 ms
98,188 KB
testcase_18 AC 104 ms
98,032 KB
testcase_19 AC 128 ms
97,408 KB
testcase_20 AC 111 ms
97,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

P = 998244353
X.sort(reverse = True)
Y.sort(reverse = True)
count = 0
for _ in range(N):
	u = X[-1]
	v = Y[-1]
	if u < v:
		count += 1
		X.pop()
	else:
		Y.pop()

U = count
V = N - count
ans = 1
for _ in range(2):
	U,V = V,U
	for i in range(1,U + 1):
		ans = ans * i % P
print(ans)
0