結果

問題 No.2790 Athena 3
ユーザー ikomaikoma
提出日時 2024-06-21 23:18:12
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 2,062 bytes
コンパイル時間 12,986 ms
コンパイル使用メモリ 408,864 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-21 23:18:26
合計ジャッジ時間 13,554 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 1 ms
6,944 KB
testcase_16 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#![allow(unused_imports, dead_code, unused_macros, unused_variables, non_snake_case, unused_parens)]
use proconio::{input,marker::{Bytes, Chars, Usize1,Isize1}};
use std::ops::*;
use std::cmp::*;
use std::mem::swap;
use std::collections::*;

const MOD:u64 = 1_000_000_007;
const INF:i64 = 0x3fff_ffff_ffff_ffff;

macro_rules! min {($a:expr $(,)*) => {{$a}};($a:expr, $b:expr $(,)*) => {{std::cmp::min($a, $b)}};($a:expr, $($rest:expr),+ $(,)*) => {{std::cmp::min($a, min!($($rest),+))}};}
macro_rules! max {($a:expr $(,)*) => {{$a}};($a:expr, $b:expr $(,)*) => {{std::cmp::max($a, $b)}};($a:expr, $($rest:expr),+ $(,)*) => {{std::cmp::max($a, max!($($rest),+))}};}
macro_rules! chmin {($base:expr, $($cmps:expr),+ $(,)*) => {{let cmp_min = min!($($cmps),+);if $base > cmp_min {$base = cmp_min;true} else {false}}};}
macro_rules! chmax {($base:expr, $($cmps:expr),+ $(,)*) => {{let cmp_max = max!($($cmps),+);if $base < cmp_max {$base = cmp_max;true} else {false}}};}
macro_rules! mulvec {($x:expr; $s:expr) => {vec![$x; $s]};($x:expr; $s0:expr; $( $s:expr );+) => {mulvec![vec![$x; $s0]; $( $s );+ ]};}
macro_rules! outputln {($var:expr)=>{println!("{}",$var)};($var:expr,$($vars:expr),+)=>{print!("{} ",$var);outputln!($($vars),+);};}
macro_rules! debug {($($a:expr),* $(,)*) => {eprintln!(concat!($("| ",stringify!($a), "={:?} "),*, "|"),$(&$a),*);};}

fn S(x1:(i32,i32), x2:(i32,i32), x3:(i32,i32)) -> f64 {
	let a = (x1.0 - x3.0) * (x2.1 - x3.1) - (x2.0 - x3.0) * (x1.1 - x3.1);
	a.abs() as f64 / 2.0
}
fn solve() {
    input! {
        XY: [(i32,i32);3],
    }
    let mut ans = 0.0;
	let dx = [-1,1];
	for bit in 0.. 1<<6 {
		let mut xy = XY.clone();
		for i in 0..3 {
			let b = (bit >> i*2) & 3;
			match b {
				0 => xy[i].0 += 1,
				1 => xy[i].0 -= 1,
				2 => xy[i].1 += 1,
				3 => xy[i].1 -= 1,
				_ => unreachable!(),
			}
		}
		chmax!(ans, S(xy[0], xy[1], xy[2]));
	}

    println!("{}", ans);
}

fn main() {
    std::thread::Builder::new()
        .stack_size(128 * 1024 * 1024)
        .spawn(|| solve()).unwrap()
        .join().unwrap();
}

0