結果

問題 No.2615 ペアの作り方
ユーザー PNJPNJ
提出日時 2024-01-26 21:32:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 631 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 109,100 KB
最終ジャッジ日時 2024-01-26 21:32:58
合計ジャッジ時間 5,523 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 39 ms
53,460 KB
testcase_03 AC 38 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 37 ms
53,460 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 AC 41 ms
53,460 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 45 ms
61,556 KB
testcase_10 AC 45 ms
61,556 KB
testcase_11 AC 54 ms
61,556 KB
testcase_12 AC 45 ms
61,556 KB
testcase_13 AC 45 ms
61,556 KB
testcase_14 AC 43 ms
61,556 KB
testcase_15 AC 602 ms
109,084 KB
testcase_16 AC 629 ms
109,096 KB
testcase_17 AC 556 ms
108,544 KB
testcase_18 AC 577 ms
109,064 KB
testcase_19 AC 604 ms
109,088 KB
testcase_20 AC 631 ms
109,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
mod = 998244353
Z = []
for x in X:
  Z.append((x,0))
for y in Y:
  Z.append((y,1))
Z.sort()
x = 0
y = 0
for i in range(N):
  c,j = Z[i]
  if j == 0:
    x += 1
  else:
    y += 1

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