結果

問題 No.1282 Display Elements
ユーザー 👑 platinumplatinum
提出日時 2020-08-22 18:41:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 524 bytes
コンパイル時間 1,874 ms
コンパイル使用メモリ 174,296 KB
実行使用メモリ 14,016 KB
最終ジャッジ日時 2024-05-06 20:13:50
合計ジャッジ時間 5,504 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,916 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 4 ms
6,940 KB
testcase_11 AC 4 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 4 ms
6,944 KB
testcase_14 AC 11 ms
6,944 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using namespace std;
using LL = long long;

int main(){
    int N;
    cin >> N;
    vector<int> a(N), b(N);
    rep(i,N) cin >> a[i];
    rep(i,N) cin >> b[i];
    sort(a.begin(),a.end());
    vector<int> c;
    LL ans=0;
    rep(i,N){
        c.emplace_back(b[i]);
        sort(c.begin(),c.end());
        LL res=lower_bound(c.begin(),c.end(),a[i])-c.begin();
        ans+=res;
    }
    cout << ans << endl;

    return 0;
}
0