結果

問題 No.2615 ペアの作り方
ユーザー noriocnorioc
提出日時 2024-01-26 22:03:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 98,196 KB
最終ジャッジ日時 2024-01-26 22:03:57
合計ジャッジ時間 2,466 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 38 ms
53,460 KB
testcase_05 AC 38 ms
53,460 KB
testcase_06 WA -
testcase_07 AC 38 ms
53,460 KB
testcase_08 AC 36 ms
53,460 KB
testcase_09 AC 40 ms
59,448 KB
testcase_10 AC 40 ms
59,448 KB
testcase_11 AC 40 ms
59,448 KB
testcase_12 WA -
testcase_13 AC 40 ms
59,448 KB
testcase_14 AC 39 ms
59,448 KB
testcase_15 AC 132 ms
97,408 KB
testcase_16 AC 122 ms
97,408 KB
testcase_17 AC 120 ms
98,196 KB
testcase_18 WA -
testcase_19 AC 120 ms
97,412 KB
testcase_20 AC 119 ms
97,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorial(n):
    res = 1
    for i in range(1, n+1):
        res *= i
        res %= MOD
    return res


MOD = 998244353
N = int(input())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))

X.sort()
Y.sort(reverse=True)

ans = 1
for i in reversed(range(N)):
    if X[i] < Y[i]:
        ans = factorial(i+1) * factorial(N-i-1) % MOD
        break

print(ans)
0