結果
問題 |
No.2615 ペアの作り方
|
ユーザー |
![]() |
提出日時 | 2022-02-07 01:00:42 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 349 ms / 2,000 ms |
コード長 | 393 bytes |
コンパイル時間 | 83 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 33,752 KB |
最終ジャッジ日時 | 2024-09-28 07:32:28 |
合計ジャッジ時間 | 3,370 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
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)