結果
問題 | No.2014 Eggs Hatching |
ユーザー |
|
提出日時 | 2022-10-15 15:32:09 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 582 bytes |
コンパイル時間 | 12,888 ms |
コンパイル使用メモリ | 378,672 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 19:55:01 |
合計ジャッジ時間 | 13,989 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | AC * 2 WA * 16 |
コンパイルメッセージ
warning: unused import: `std::fs::read` --> src/main.rs:1:5 | 1 | use std::fs::read; | ^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
ソースコード
use std::fs::read;fn main() {// use std::io::stdin// 標準入力からスペース区切りで与えられるa1,a2,a3を出力するlet mut a = String::new();std::io::stdin().read_line(&mut a).unwrap();let a: Vec<f64> = a.split_whitespace().map(|x| x.parse().unwrap()).collect();// println!("{} {} {}", a[0], a[1], a[2]);// aの最大値を出力するlet max = a.iter().max_by(|x, y| x.partial_cmp(y).unwrap()).unwrap();// println!("{}", max);let num = a.iter().position(|x| x == max).unwrap();println!("{}", num + 1);}