結果
| 問題 | No.2615 ペアの作り方 |
| コンテスト | |
| ユーザー |
鴨志田卓
|
| 提出日時 | 2024-02-02 00:09:21 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 813 bytes |
| 記録 | |
| コンパイル時間 | 2,059 ms |
| コンパイル使用メモリ | 219,056 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-03 13:29:14 |
| 合計ジャッジ時間 | 3,503 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void fileIO(string s) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
const int N = 2e5 + 10;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> a(n), b(n), c;
for(int i = 0; i < n; i ++)
cin >> a[i];
for(int i = 0; i < n; i ++)
cin >> b[i];
c = a;
c.insert(c.end(), b.begin(), b.end());
sort(c.begin(), c.end());
int ans = 1, cnt = 0;
for(int i = 0; i < n; i ++) {
if(a[i] < c[n]) cnt ++;
}
for(int i = 1; i <= cnt; i ++)
ans = (long long)ans * i % 998244353;
cnt = n - cnt;
for(int i = 1; i <= cnt; i ++)
ans = (long long)ans * i % 998244353;
cout << ans;
return 0;
}
鴨志田卓