結果
問題 | No.1319 最強とんがりコーン |
ユーザー | akakimidori |
提出日時 | 2020-12-16 01:30:40 |
言語 | Rust (1.77.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,347 bytes |
コンパイル時間 | 697 ms |
コンパイル使用メモリ | 173,384 KB |
実行使用メモリ | 4,372 KB |
最終ジャッジ日時 | 2023-10-20 08:37:07 |
合計ジャッジ時間 | 38,287 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 557 ms
4,348 KB |
testcase_03 | AC | 306 ms
4,348 KB |
testcase_04 | WA | - |
testcase_05 | AC | 852 ms
4,348 KB |
testcase_06 | AC | 601 ms
4,348 KB |
testcase_07 | AC | 357 ms
4,348 KB |
testcase_08 | AC | 640 ms
4,348 KB |
testcase_09 | AC | 921 ms
4,348 KB |
testcase_10 | AC | 111 ms
4,348 KB |
testcase_11 | AC | 422 ms
4,348 KB |
testcase_12 | AC | 693 ms
4,348 KB |
testcase_13 | AC | 440 ms
4,348 KB |
testcase_14 | AC | 171 ms
4,348 KB |
testcase_15 | AC | 480 ms
4,348 KB |
testcase_16 | AC | 206 ms
4,348 KB |
testcase_17 | WA | - |
testcase_18 | AC | 245 ms
4,348 KB |
testcase_19 | WA | - |
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 | 600 ms
4,348 KB |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | AC | 418 ms
4,348 KB |
testcase_41 | AC | 101 ms
4,348 KB |
testcase_42 | AC | 160 ms
4,348 KB |
testcase_43 | AC | 110 ms
4,348 KB |
testcase_44 | AC | 166 ms
4,348 KB |
testcase_45 | WA | - |
testcase_46 | AC | 820 ms
4,348 KB |
testcase_47 | AC | 124 ms
4,348 KB |
testcase_48 | AC | 410 ms
4,348 KB |
testcase_49 | AC | 132 ms
4,348 KB |
testcase_50 | AC | 119 ms
4,348 KB |
testcase_51 | AC | 90 ms
4,348 KB |
testcase_52 | AC | 109 ms
4,348 KB |
testcase_53 | WA | - |
testcase_54 | AC | 196 ms
4,348 KB |
testcase_55 | AC | 159 ms
4,348 KB |
testcase_56 | AC | 104 ms
4,348 KB |
testcase_57 | WA | - |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | AC | 53 ms
4,348 KB |
testcase_61 | AC | 52 ms
4,348 KB |
testcase_62 | AC | 53 ms
4,348 KB |
testcase_63 | AC | 53 ms
4,348 KB |
testcase_64 | AC | 614 ms
4,348 KB |
testcase_65 | AC | 614 ms
4,348 KB |
testcase_66 | AC | 53 ms
4,348 KB |
testcase_67 | WA | - |
testcase_68 | AC | 942 ms
4,348 KB |
testcase_69 | WA | - |
testcase_70 | AC | 137 ms
4,348 KB |
ソースコード
// ---------- 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 sum = 0f64; let mut c = 0f64; let n = 50000000; let f = 1f64 / n as f64; let de = (0..6).map(|k| ((!k & 1) * 2 - 1) as f64 / (1..=(2 * k + 3)).fold(1f64, |s, a| s * a as f64)).collect::<Vec<_>>(); let func = |r: f64| -> f64 { let p = (d / 2.0 / r).acos() * 2.0; let pp = p * p; let mut v = 0f64; for de in de.iter().rev() { v = v * pp + *de; } v *= r * r * pp * p; v }; 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(); }