結果
問題 | No.1551 誕生日の三角形 |
ユーザー |
![]() |
提出日時 | 2021-06-18 23:07:30 |
言語 | Rust (1.83.0 + proconio) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 2,048 bytes |
コンパイル時間 | 15,501 ms |
コンパイル使用メモリ | 380,176 KB |
最終ジャッジ日時 | 2024-11-15 01:28:40 |
合計ジャッジ時間 | 16,200 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
error: format argument must be a string literal --> src/main.rs:10:34 | 10 | Err(e) => panic!(e), | ^ | help: you might be missing a string literal to format with | 10 | Err(e) => panic!("{}", e), | +++++ error: could not compile `main` (bin "main") due to 1 previous error
ソースコード
pub mod io {use std::io::{BufRead, ErrorKind};pub fn scan<R: BufRead>(r: &mut R) -> Vec<u8> {let mut res = Vec::new();loop {let buf = match r.fill_buf() {Ok(buf) => buf,Err(e) if e.kind() == ErrorKind::Interrupted => continue,Err(e) => panic!(e),};let (done, used, buf) = {match buf.iter().position(u8::is_ascii_whitespace) {Some(i) => (i > 0 || res.len() > 0, i + 1, &buf[..i]),None => (buf.is_empty(), buf.len(), buf),}};res.extend_from_slice(buf);r.consume(used);if done { return res; }}}#[macro_export]macro_rules! scan {($r:expr, [$t:tt; $n:expr]) => {(0..$n).map(|_| scan!($r, $t)).collect::<Vec<_>>()};($r:expr, [$t:tt]) => {scan!($r, [$t; scan!($r, usize)])};($r:expr, ($($t:tt),*)) => {($(scan!($r, $t)),*)};($r:expr, Usize1) => {scan!($r, usize) - 1};($r:expr, Bytes) => {io::scan($r)};($r:expr, String) => {String::from_utf8(scan!($r, Bytes)).unwrap()};($r:expr, $t:ty) => {scan!($r, String).parse::<$t>().unwrap()};}#[macro_export]macro_rules! input {($r:expr, $($($v:ident)* : $t:tt),* $(,)?) => {$(let $($v)* = scan!($r, $t);)*};}}fn run<R: std::io::BufRead, W: std::io::Write>(reader: &mut R, writer: &mut W) {input! {reader,l: f64,}let s = l * 0.5;writeln!(writer, "{}", (s * (s - l / 3.0).powi(3)).sqrt()).ok();}fn main() {let (stdin, stdout) = (std::io::stdin(), std::io::stdout());let ref mut reader = std::io::BufReader::new(stdin.lock());let ref mut writer = std::io::BufWriter::new(stdout.lock());run(reader, writer);}