結果
問題 |
No.2615 ペアの作り方
|
ユーザー |
![]() |
提出日時 | 2024-01-26 21:29:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 130 ms / 2,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 207 ms |
コンパイル使用メモリ | 82,324 KB |
実行使用メモリ | 98,240 KB |
最終ジャッジ日時 | 2024-09-28 07:41:08 |
合計ジャッジ時間 | 2,511 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) A.sort() B.sort(reverse=True) x=0 y=0 for i in range(N): if A[i]>B[i]: x+=1 else: y+=1 w=1 result=1 mod=998244353 for z in range(1,x+1): w*=z w%=mod result*=w result%=mod w=1 for z in range(1,y+1): w*=z w%=mod result*=w result%=mod print(result)