結果
問題 |
No.1882 Areas of Triangle
|
ユーザー |
|
提出日時 | 2022-04-03 21:31:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 23 ms / 2,000 ms |
コード長 | 361 bytes |
コンパイル時間 | 1,515 ms |
コンパイル使用メモリ | 172,812 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 05:01:15 |
合計ジャッジ時間 | 2,716 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; long long K; cin>>N>>K; K*=2; vector<int>A(N); for(int &i:A)cin>>i; sort(A.begin(),A.end()); long long ans=0; for(int i=0;i<N;i++){ ans+=N-(lower_bound(A.begin(),A.end(),(K+A[i]-1)/A[i])-A.begin()); } cout<<ans<<endl; }