結果

問題 No.1282 Display Elements
ユーザー 👑 platinumplatinum
提出日時 2020-08-22 18:40:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 557 bytes
コンパイル時間 1,463 ms
コンパイル使用メモリ 168,912 KB
実行使用メモリ 10,140 KB
最終ジャッジ日時 2024-05-06 20:12:29
合計ジャッジ時間 5,368 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,448 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
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];
    LL ans=0;
    vector<int> c(N);
    rep(i,N) c[i]=i;
    do{
        LL res=0;
        rep(i,N){
            int A=a[c[i]];
            rep(j,i+1) if(A>b[j]) res++;
        }
        ans=max(ans,res);

    }while(next_permutation(c.begin(),c.end()));
    cout << ans << endl;

    return 0;
}
0