結果
| 問題 | No.1882 Areas of Triangle |
| ユーザー |
|
| 提出日時 | 2024-04-09 12:38:59 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 1,089 bytes |
| 記録 | |
| コンパイル時間 | 2,579 ms |
| コンパイル使用メモリ | 120,756 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-07 18:50:47 |
| 合計ジャッジ時間 | 16,953 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 20 WA * 1 TLE * 3 |
ソースコード
#define _USE_MATH_DEFINES
#include <iostream> //cin, cout
#include <vector> //vector
#include <algorithm> //sort,min,max,count
#include <string> //string,getline, to_string
#include <cstdlib> //abs(int)
#include <utility> //swap, pair
#include <tuple> //tuple
#include <deque> //deque
#include <climits> //INT_MAX
#include <bitset> //bitset
#include <cmath> //sqrt, ceil. M_PI, pow, sin
#include <ios> //fixed
#include <iomanip> //setprecision
#include <sstream> //stringstream
#include <numeric> //gcd, assumlate
#include <random> //randam_device
#include <limits> //numeric_limits
#include <functional>
using namespace std;
constexpr long long int D_MOD = 1000000007;
int main() {
int64_t N, K;
cin >> N >> K;
K = 2 * K;
vector<int64_t> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
}
sort(A.rbegin(), A.rend());
int64_t ans = 0;
for (int i = 0; i < N - 1; i++) {
for (int j = i; j < N; j++) {
if (A.at(i) * A.at(j) >= K) {
ans++;
if (i != j) {
ans++;
}
}
else {
break;
}
}
}
cout << ans << endl;
}