結果
| 問題 |
No.1282 Display Elements
|
| コンテスト | |
| ユーザー |
Example0911
|
| 提出日時 | 2020-11-06 21:45:47 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 124 ms / 2,000 ms |
| コード長 | 391 bytes |
| コンパイル時間 | 2,585 ms |
| コンパイル使用メモリ | 197,564 KB |
| 最終ジャッジ日時 | 2025-01-15 20:29:59 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main() {
int N; cin >> N;
vector<int>a(N), b(N);
for (int i = 0; i < N; i++)cin >> a[i];
for (int i = 0; i < N; i++)cin >> b[i];
sort(a.begin(), a.end());
long long ans = 0;
for (int i = 0; i < N; i++) {
int idx = upper_bound(a.begin(), a.end(), b[i]) - a.begin();
idx = max(idx, i);
ans += N - idx;
}
cout << ans << endl;
}
Example0911