結果
問題 | No.2615 ペアの作り方 |
ユーザー |
![]() |
提出日時 | 2024-01-29 16:39:18 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 172 ms / 2,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 145 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 128,980 KB |
最終ジャッジ日時 | 2024-09-28 10:01:57 |
合計ジャッジ時間 | 2,602 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
n = int(input()) fact = [1] * (n + 1) MOD = 998244353 for i in range(1, n + 1): fact[i] = fact[i - 1] * i % MOD x = list(map(int, input().split())) y = list(map(int, input().split())) xy = list(sorted(x + y)) is_low = {} for i in range(2 * n): is_low[xy[i]] = i < n cnt_x = 0 cnt_y = 0 for xx in x: cnt_x += is_low[xx] print(fact[n - cnt_x] * fact[cnt_x] % MOD)