結果

問題 No.1319 最強とんがりコーン
ユーザー akakimidoriakakimidori
提出日時 2020-12-17 04:21:02
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 1,045 bytes
コンパイル時間 583 ms
コンパイル使用メモリ 168,224 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 10:35:25
合計ジャッジ時間 16,381 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 297 ms
4,348 KB
testcase_01 AC 300 ms
4,348 KB
testcase_02 AC 207 ms
4,348 KB
testcase_03 AC 117 ms
4,348 KB
testcase_04 AC 309 ms
4,348 KB
testcase_05 AC 313 ms
4,348 KB
testcase_06 AC 223 ms
4,348 KB
testcase_07 AC 131 ms
4,348 KB
testcase_08 AC 236 ms
4,348 KB
testcase_09 AC 328 ms
4,348 KB
testcase_10 WA -
testcase_11 AC 153 ms
4,348 KB
testcase_12 AC 247 ms
4,348 KB
testcase_13 AC 166 ms
4,348 KB
testcase_14 AC 70 ms
4,348 KB
testcase_15 AC 179 ms
4,348 KB
testcase_16 AC 79 ms
4,348 KB
testcase_17 AC 357 ms
4,348 KB
testcase_18 AC 93 ms
4,348 KB
testcase_19 AC 349 ms
4,348 KB
testcase_20 AC 292 ms
4,348 KB
testcase_21 AC 292 ms
4,348 KB
testcase_22 AC 286 ms
4,348 KB
testcase_23 AC 287 ms
4,348 KB
testcase_24 AC 284 ms
4,348 KB
testcase_25 AC 292 ms
4,348 KB
testcase_26 AC 293 ms
4,348 KB
testcase_27 AC 288 ms
4,348 KB
testcase_28 AC 287 ms
4,348 KB
testcase_29 AC 283 ms
4,348 KB
testcase_30 AC 297 ms
4,348 KB
testcase_31 AC 294 ms
4,348 KB
testcase_32 AC 216 ms
4,348 KB
testcase_33 AC 327 ms
4,348 KB
testcase_34 AC 291 ms
4,348 KB
testcase_35 AC 288 ms
4,348 KB
testcase_36 AC 287 ms
4,348 KB
testcase_37 AC 292 ms
4,348 KB
testcase_38 AC 291 ms
4,348 KB
testcase_39 AC 302 ms
4,348 KB
testcase_40 AC 154 ms
4,348 KB
testcase_41 WA -
testcase_42 AC 62 ms
4,348 KB
testcase_43 WA -
testcase_44 AC 65 ms
4,348 KB
testcase_45 WA -
testcase_46 AC 298 ms
4,348 KB
testcase_47 WA -
testcase_48 AC 154 ms
4,348 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 80 ms
4,348 KB
testcase_55 AC 65 ms
4,348 KB
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 AC 26 ms
4,348 KB
testcase_61 AC 26 ms
4,348 KB
testcase_62 AC 26 ms
4,348 KB
testcase_63 AC 26 ms
4,348 KB
testcase_64 AC 224 ms
4,348 KB
testcase_65 AC 224 ms
4,348 KB
testcase_66 AC 26 ms
4,348 KB
testcase_67 AC 284 ms
4,348 KB
testcase_68 AC 346 ms
4,348 KB
testcase_69 AC 288 ms
4,348 KB
testcase_70 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

fn calc(d: f64) -> f64 {
    let func = |r: f64| -> f64 {
        if 2.0 * r < d {
            return 0f64;
        }
        let p = (d / (2.0 * r)).acos() * 2.0;
        let pp = p * p;
        let mut v = 0f64;
        let m = 17;
        let mut de = -1.0 / (1..=m).fold(1f64, |s, a| s * a as f64);
        for i in 0..=7 {
            v = v * pp + de;
            de = -de * ((m - 2 * i) * (m - 2 * i - 1)) as f64;
        }
        v * r * r * pp * p
    };
    let n = 1 << 24;
    let f = 1f64 / n as f64;
    let mut sum = 0f64;
    for i in (0..n).rev() {
        let l = (n - 1 - i) as f64 * f;
        sum += func(l);
    }
    sum * f
}

fn run() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let mut it = s.trim().split_whitespace();
    let r: f64 = it.next().unwrap().parse().unwrap();
    let h: f64 = it.next().unwrap().parse().unwrap();
    let d: f64 = it.next().unwrap().parse().unwrap();
    let ans = r * r * h * calc(d / r);
    println!("{:.7}", ans);
}

fn main() {
    run();
}
0