結果

問題 No.1882 Areas of Triangle
ユーザー
提出日時 2024-07-02 17:19:14
言語 Rust
(1.83.0 + proconio)
結果
TLE  
実行時間 -
コード長 492 bytes
コンパイル時間 11,863 ms
コンパイル使用メモリ 402,376 KB
実行使用メモリ 10,788 KB
最終ジャッジ日時 2024-07-02 17:19:41
合計ジャッジ時間 16,190 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 -- * 4
other AC * 3 TLE * 1 -- * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::Read;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let l: Vec<_> = s.lines().collect();
	let n: Vec<usize> = l[0].split(' ').flat_map(str::parse).collect();
	let mut a: Vec<usize> = l[1].split(' ').flat_map(str::parse).collect();
	a.sort();
	a.reverse();
	let mut x = 0;
	for i in 0..n[0] {
		for j in i..n[0] {
			if a[i] * a[j] >= n[1] * 2 {
				x += if i == j { 1 } else { 2 };
			} else {
				break;
			}
		}
	}
	println!("{x}")
}
0