結果

問題 No.2615 ペアの作り方
コンテスト
ユーザー Navier_Boltzmann
提出日時 2024-01-27 20:32:47
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 398 ms / 2,000 ms
コード長 447 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 366 ms
コンパイル使用メモリ 85,628 KB
実行使用メモリ 106,680 KB
最終ジャッジ日時 2026-04-15 01:33:53
合計ジャッジ時間 4,025 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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