結果

問題 No.2615 ペアの作り方
ユーザー 👑 timitimi
提出日時 2024-01-26 21:34:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 625 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 127,532 KB
最終ジャッジ日時 2024-01-26 21:34:18
合計ジャッジ時間 5,624 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
65,900 KB
testcase_01 AC 46 ms
65,896 KB
testcase_02 AC 47 ms
65,896 KB
testcase_03 AC 45 ms
65,900 KB
testcase_04 AC 45 ms
65,900 KB
testcase_05 AC 45 ms
65,900 KB
testcase_06 AC 45 ms
65,900 KB
testcase_07 AC 45 ms
65,896 KB
testcase_08 AC 46 ms
65,896 KB
testcase_09 AC 50 ms
68,236 KB
testcase_10 AC 51 ms
68,236 KB
testcase_11 AC 50 ms
68,236 KB
testcase_12 AC 49 ms
68,236 KB
testcase_13 AC 50 ms
68,236 KB
testcase_14 AC 49 ms
68,236 KB
testcase_15 AC 602 ms
127,132 KB
testcase_16 AC 619 ms
127,516 KB
testcase_17 AC 598 ms
126,608 KB
testcase_18 AC 625 ms
127,104 KB
testcase_19 AC 579 ms
126,876 KB
testcase_20 AC 608 ms
127,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
X=list(map(int, input().split()))
Y=list(map(int, input().split()))
Z=[]
for i in range(N):
  Z.append((X[i],1,i))
  Z.append((Y[i],2,i))
Z=sorted(Z)
x,y=0,0
for _ ,a,i in Z[:N]:
  if a==1:
    x+=1
  else:
    y+=1

D=[1]
mod=998244353
for i in range(1,10**5+10):
  D.append(D[-1]*i)
  D[-1]%=mod 
ans=D[x]*D[y]%mod 
print(ans)
0