結果

問題 No.1319 最強とんがりコーン
ユーザー akakimidoriakakimidori
提出日時 2020-12-16 01:36:00
言語 Rust
(1.77.0)
結果
TLE  
実行時間 -
コード長 2,084 bytes
コンパイル時間 476 ms
コンパイル使用メモリ 165,408 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 08:42:14
合計ジャッジ時間 82,744 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,859 ms
4,348 KB
testcase_01 AC 1,916 ms
4,348 KB
testcase_02 AC 1,106 ms
4,348 KB
testcase_03 AC 593 ms
4,348 KB
testcase_04 TLE -
testcase_05 AC 1,878 ms
4,348 KB
testcase_06 AC 1,220 ms
4,348 KB
testcase_07 AC 707 ms
4,348 KB
testcase_08 AC 1,282 ms
4,348 KB
testcase_09 TLE -
testcase_10 AC 197 ms
4,348 KB
testcase_11 AC 822 ms
4,348 KB
testcase_12 AC 1,387 ms
4,348 KB
testcase_13 AC 883 ms
4,348 KB
testcase_14 AC 320 ms
4,348 KB
testcase_15 AC 955 ms
4,348 KB
testcase_16 AC 380 ms
4,348 KB
testcase_17 TLE -
testcase_18 AC 466 ms
4,348 KB
testcase_19 TLE -
testcase_20 AC 1,859 ms
4,348 KB
testcase_21 AC 1,920 ms
4,348 KB
testcase_22 AC 1,823 ms
4,348 KB
testcase_23 AC 1,854 ms
4,348 KB
testcase_24 AC 1,841 ms
4,348 KB
testcase_25 AC 1,888 ms
4,348 KB
testcase_26 AC 1,844 ms
4,348 KB
testcase_27 AC 1,834 ms
4,348 KB
testcase_28 AC 1,832 ms
4,348 KB
testcase_29 AC 1,827 ms
4,348 KB
testcase_30 AC 1,872 ms
4,348 KB
testcase_31 AC 1,859 ms
4,348 KB
testcase_32 AC 1,196 ms
4,348 KB
testcase_33 TLE -
testcase_34 AC 1,836 ms
4,348 KB
testcase_35 AC 1,894 ms
4,348 KB
testcase_36 AC 1,850 ms
4,348 KB
testcase_37 AC 1,888 ms
4,348 KB
testcase_38 AC 1,849 ms
4,348 KB
testcase_39 TLE -
testcase_40 AC 827 ms
4,348 KB
testcase_41 AC 181 ms
4,348 KB
testcase_42 AC 289 ms
4,348 KB
testcase_43 AC 196 ms
4,348 KB
testcase_44 AC 306 ms
4,348 KB
testcase_45 AC 140 ms
4,348 KB
testcase_46 AC 1,751 ms
4,348 KB
testcase_47 AC 226 ms
4,348 KB
testcase_48 AC 821 ms
4,348 KB
testcase_49 AC 244 ms
4,348 KB
testcase_50 AC 212 ms
4,348 KB
testcase_51 AC 158 ms
4,348 KB
testcase_52 AC 198 ms
4,348 KB
testcase_53 WA -
testcase_54 AC 374 ms
4,348 KB
testcase_55 AC 302 ms
4,348 KB
testcase_56 AC 183 ms
4,348 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 AC 74 ms
4,348 KB
testcase_61 AC 73 ms
4,348 KB
testcase_62 AC 73 ms
4,348 KB
testcase_63 AC 73 ms
4,348 KB
testcase_64 AC 1,236 ms
4,348 KB
testcase_65 AC 1,238 ms
4,348 KB
testcase_66 AC 73 ms
4,348 KB
testcase_67 AC 1,815 ms
4,348 KB
testcase_68 TLE -
testcase_69 AC 1,820 ms
4,348 KB
testcase_70 AC 245 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// ---------- begin input macro ----------
// reference: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, bytes) => {
        read_value!($iter, String).bytes().collect::<Vec<u8>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
// ---------- end input macro ----------

fn calc(d: f64) -> f64 {
    let n = 70000000;
    let f = 1f64 / n as f64;
    let func = |r: f64| -> f64 {
        let p = (d * 0.5 / r).acos() * 2.0;
        r * r * (p - p.sin())
    };
    let mut sum = 0f64;
    let mut c = 0f64;
    for i in (0..n).rev() {
        let r = (n - i) as f64 * f;
        if 2.0 * r < d {
            continue;
        }
        let v = func(r);
        let y = v - c;
        let t = sum + y;
        c = (t - sum) - y;
        sum = t;
    }
    sum * f
}

fn run() {
    input! {
        r: f64,
        h: f64,
        d: f64,
    }
    let ans = r * r * h * calc(d / r);
    println!("{:.7}", ans);
}

fn main() {
    run();
}
0