結果
問題 | No.881 sin(x)/xの和 |
ユーザー |
![]() |
提出日時 | 2023-02-19 23:15:06 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 449 bytes |
コンパイル時間 | 17,553 ms |
コンパイル使用メモリ | 377,816 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 20:49:12 |
合計ジャッジ時間 | 14,988 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
コンパイルメッセージ
warning: variable does not need to be mutable --> src/main.rs:12:13 | 12 | let mut itr = s.trim().split_whitespace(); | ----^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
ソースコード
use std::f64::consts::PI;fn main() {let mut s = String::new();std::io::stdin().read_line(&mut s).ok();let n: usize = s.trim().parse().unwrap();let mut ans: f64 = 0.;for _ in 0..n {let mut s = String::new();std::io::stdin().read_line(&mut s).ok();let mut itr = s.trim().split_whitespace();ans += itr.skip(1).next().unwrap().parse::<f64>().unwrap();}println!("{}", ans * PI);}