結果

問題 No.2615 ペアの作り方
ユーザー hato336hato336
提出日時 2024-01-26 21:29:38
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 575 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 157,516 KB
最終ジャッジ日時 2024-01-26 21:29:45
合計ジャッジ時間 6,257 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
85,048 KB
testcase_01 AC 126 ms
85,048 KB
testcase_02 AC 152 ms
85,048 KB
testcase_03 AC 126 ms
85,048 KB
testcase_04 AC 126 ms
85,048 KB
testcase_05 AC 127 ms
85,048 KB
testcase_06 AC 129 ms
85,048 KB
testcase_07 AC 125 ms
85,048 KB
testcase_08 AC 125 ms
85,048 KB
testcase_09 AC 137 ms
88,760 KB
testcase_10 AC 139 ms
88,760 KB
testcase_11 AC 141 ms
88,760 KB
testcase_12 AC 140 ms
88,760 KB
testcase_13 AC 138 ms
88,760 KB
testcase_14 AC 139 ms
88,760 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0