結果

問題 No.1882 Areas of Triangle
ユーザー 👑 CleyL
提出日時 2022-07-05 09:42:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 1,088 ms
コンパイル使用メモリ 78,740 KB
最終ジャッジ日時 2025-01-30 04:43:39
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    long long n,k;cin>>n>>k;
    vector<long long> A(n);
    for(int i = 0; n > i; i++){
        cin>>A[i];
    }
    sort(A.begin(),A.end());
    long long ans = 0;
    for(int i = 0; n > i; i++){
        ans += A.end()-lower_bound(A.begin(),A.end(),(2*k+A[i]-1)/A[i]);
    }
    cout << ans << endl;
}
0