結果
| 問題 |
No.2615 ペアの作り方
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-01-26 21:29:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 575 bytes |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 82,276 KB |
| 実行使用メモリ | 158,304 KB |
| 最終ジャッジ日時 | 2024-09-28 07:41:25 |
| 合計ジャッジ時間 | 6,262 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 TLE * 1 -- * 5 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
#input = sys.stdin.readline
n = int(input())
mod = 998244353
x = list(map(int,input().split()))
y = list(map(int,input().split()))
z = x + y
z.sort()
xx = set(x)
yy = set(y)
xxx = 0
yyy = 0
for i in range(n):
if z[i] in x:
xxx += 1
else:
yyy += 1
zzz = max(xxx,yyy)
ans = 1
for i in range(1,zzz+1):
if i <= xxx:
ans *= i
if i <= yyy:
ans *= i
ans %= mod
print(ans)