結果

問題 No.1319 最強とんがりコーン
ユーザー akakimidoriakakimidori
提出日時 2020-12-16 00:37:49
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 2,199 bytes
コンパイル時間 2,048 ms
コンパイル使用メモリ 159,120 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 07:27:10
合計ジャッジ時間 61,887 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1,245 ms
4,348 KB
testcase_03 AC 678 ms
4,348 KB
testcase_04 WA -
testcase_05 AC 1,927 ms
4,348 KB
testcase_06 AC 1,382 ms
4,348 KB
testcase_07 AC 799 ms
4,348 KB
testcase_08 AC 1,434 ms
4,348 KB
testcase_09 TLE -
testcase_10 AC 241 ms
4,348 KB
testcase_11 AC 928 ms
4,348 KB
testcase_12 AC 1,567 ms
4,348 KB
testcase_13 AC 996 ms
4,348 KB
testcase_14 AC 379 ms
4,348 KB
testcase_15 AC 1,072 ms
4,348 KB
testcase_16 AC 445 ms
4,348 KB
testcase_17 TLE -
testcase_18 AC 536 ms
4,348 KB
testcase_19 TLE -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 1,347 ms
4,348 KB
testcase_33 TLE -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 933 ms
4,348 KB
testcase_41 AC 226 ms
4,348 KB
testcase_42 AC 343 ms
4,348 KB
testcase_43 AC 239 ms
4,348 KB
testcase_44 AC 364 ms
4,348 KB
testcase_45 AC 178 ms
4,348 KB
testcase_46 AC 1,861 ms
4,348 KB
testcase_47 AC 275 ms
4,348 KB
testcase_48 AC 936 ms
4,348 KB
testcase_49 AC 294 ms
4,348 KB
testcase_50 AC 258 ms
4,348 KB
testcase_51 AC 195 ms
4,348 KB
testcase_52 AC 239 ms
4,348 KB
testcase_53 AC 154 ms
4,348 KB
testcase_54 AC 437 ms
4,348 KB
testcase_55 AC 357 ms
4,348 KB
testcase_56 AC 224 ms
4,348 KB
testcase_57 AC 162 ms
4,348 KB
testcase_58 AC 156 ms
4,348 KB
testcase_59 WA -
testcase_60 AC 107 ms
4,348 KB
testcase_61 AC 104 ms
4,348 KB
testcase_62 AC 106 ms
4,348 KB
testcase_63 AC 104 ms
4,348 KB
testcase_64 AC 1,395 ms
4,348 KB
testcase_65 AC 1,399 ms
4,348 KB
testcase_66 AC 105 ms
4,348 KB
testcase_67 WA -
testcase_68 TLE -
testcase_69 WA -
testcase_70 AC 295 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 mut ans = 0f64;
    let n = 100000000;
    let f = 1f64 / n as f64;
    for i in (0..n).rev() {
        let r = (n - i) as f64 * f;
        if 2.0 * r < d {
            continue;
        }
        let p = (d / 2.0 / r).acos() * 2.0;
//        ans += r * r * (p - p.sin());
        let mut v = 0f64;
        let mut de = -1.0 / (1..=13).fold(1f64, |s, a| s * a as f64);
        for i in 0..=5 {
            v = v * p * p + de;
            de = -de * (13 - 2 * i) as f64 * (13 - 2 * i - 1) as f64;
        }
        v *= p * p * p;
        ans += r * r * v;
    }
    ans * 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