結果
問題 |
No.1282 Display Elements
|
ユーザー |
![]() |
提出日時 | 2020-08-22 18:40:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 557 bytes |
コンパイル時間 | 1,580 ms |
コンパイル使用メモリ | 170,676 KB |
実行使用メモリ | 18,112 KB |
最終ジャッジ日時 | 2024-11-29 06:12:24 |
合計ジャッジ時間 | 44,571 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 TLE * 14 |
ソースコード
#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; }