結果

問題 No.3074 Divide Points Fairly
ユーザー urectanc
提出日時 2025-03-28 22:00:47
言語 Rust
(1.83.0 + proconio)
結果
TLE  
実行時間 -
コード長 745 bytes
コンパイル時間 12,878 ms
コンパイル使用メモリ 406,504 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-28 22:01:13
合計ジャッジ時間 23,908 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 TLE * 1 -- * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn main() {
    input! {
        n: usize,
        points: [(i64, i64); 2 * n]
    }

    let p = [
        99877, 99881, 99901, 99907, 99923, 99929, 99961, 99971, 99989, 99991,
    ];

    for i in 0..10 {
        for j in 0..i {
            let (a, b) = (p[i], p[j]);
            let mut z = points
                .iter()
                .map(|&(x, y)| a * x + b * y)
                .collect::<Vec<_>>();
            z.sort_unstable();
            eprintln!("{z:?}");
            let c0 = z[n - 1];
            let c1 = z[n];

            if c0 < c1 && c0 + 1 < c1 {
                let c = -(c0 + 1);
                println!("{a} {b} {c}");
                return;
            }
        }
    }
    unreachable!();
}
0