結果
| 問題 | No.1282 Display Elements | 
| コンテスト | |
| ユーザー |  umezo | 
| 提出日時 | 2020-11-06 22:53:56 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 107 ms / 2,000 ms | 
| コード長 | 400 bytes | 
| コンパイル時間 | 2,020 ms | 
| コンパイル使用メモリ | 197,612 KB | 
| 最終ジャッジ日時 | 2025-01-15 21:11:21 | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 24 | 
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include <bits/stdc++.h>
using namespace std;
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(ALL(A));
  
  ll cnt=0;
  rep(i,n){
    cnt+=A.end()-upper_bound(A.begin()+i,A.end(),B[i]);
  }
  cout<<cnt<<endl;
         
  return 0;
}
            
            
            
        