結果
| 問題 |
No.1882 Areas of Triangle
|
| ユーザー |
ripity
|
| 提出日時 | 2022-03-20 16:15:32 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 613 bytes |
| コンパイル時間 | 10,122 ms |
| コンパイル使用メモリ | 275,344 KB |
| 最終ジャッジ日時 | 2025-01-28 10:50:15 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 22 TLE * 2 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
//TLE解
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int N;
ll K;
cin >> N >> K;
ll ans = 0;
vector<ll> a(N+1);
K <<= 1;
for( int i = 0; i < N; ++i ) {
cin >> a[i];
}
for( int i = 0; i < N; ++i ) {
if( a[i]*a[i] >= K ) ++ans;
for( int j = i+1; j < N; ++j ) {
if( a[i]*a[j] >= K ) ans += 2;
}
}
cout << ans << "\n";
}
ripity