結果
問題 | No.2615 ペアの作り方 |
ユーザー |
|
提出日時 | 2024-01-27 13:55:59 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 534 bytes |
コンパイル時間 | 1,798 ms |
コンパイル使用メモリ | 196,392 KB |
最終ジャッジ日時 | 2025-02-19 00:14:18 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 6 |
ソースコード
#include<bits/stdc++.h>using namespace std;#define int unsigned long longconst int mod = 998244353;signed main(){int n;cin >> n;int x[n],y[n];for(int i = 0;i < n;i++) cin >> x[i];for(int i = 0;i < n;i++) cin >> y[i];sort(x,x + n);sort(y,y + n);reverse(y,y + n);int t = 0;for(int i = 0;i < n;i++){if(x[i] < y[i])t++;}vector<int> a(n + 1);a[1] = 1;for(int i = 2;i <= n;i++){a[i] = a[i - 1] * i;a[i] %= mod;}if(t == n or t == 0) cout << a[t] << endl;cout << a[t] * a[n - t] % mod << endl;}