結果

問題 No.2615 ペアの作り方
ユーザー tassei903
提出日時 2025-07-15 17:43:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 361 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 98,824 KB
最終ジャッジ日時 2025-07-15 17:43:30
合計ジャッジ時間 2,612 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort()

ans = 0
i = 0
j = 0
for _ in range(n):
    if a[i] < b[j]:
        i += 1
    else:
        j += 1
mod = 998244353
def f(x):
    ans = 1
    for i in range(x):
        ans *= i + 1
        ans %= mod
    return ans
# print(i)
print(f(i) * f(n-i) % mod)
0