結果

問題 No.785 色食い虫
ユーザー Miyu Osanai
提出日時 2019-03-21 13:51:34
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 12,471 ms
コンパイル使用メモリ 387,292 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-19 01:30:31
合計ジャッジ時間 13,742 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: use of deprecated method `core::str::<impl str>::trim_right`: superseded by `trim_end`
  --> src/main.rs:12:11
   |
12 |         s.trim_right().to_owned()
   |           ^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default
help: replace the use of the deprecated method
   |
12 |         s.trim_end().to_owned()
   |           ~~~~~~~~

ソースコード

diff #

fn main() {
    let r = read_and_count();
    let g = read_and_count();
    let b = read_and_count();
    println!("{:?}", r*g*b);
}

fn read_and_count () -> usize {
    let s = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    };
    if s == "NONE" {
        16 * 16
    } else {
        (16 - s.split(",").count()).pow(2)
    }
}
0