結果

問題 No.909 たぴの配置
ユーザー akakimidoriakakimidori
提出日時 2019-10-18 23:25:30
言語 Rust
(1.77.0)
結果
AC  
実行時間 28 ms / 3,000 ms
コード長 761 bytes
コンパイル時間 834 ms
コンパイル使用メモリ 146,376 KB
実行使用メモリ 7,596 KB
最終ジャッジ日時 2023-09-08 02:42:06
合計ジャッジ時間 3,819 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 26 ms
7,568 KB
testcase_06 AC 27 ms
7,584 KB
testcase_07 AC 25 ms
7,500 KB
testcase_08 AC 28 ms
7,532 KB
testcase_09 AC 28 ms
7,572 KB
testcase_10 AC 27 ms
7,596 KB
testcase_11 AC 26 ms
7,496 KB
testcase_12 AC 24 ms
7,500 KB
testcase_13 AC 26 ms
7,588 KB
testcase_14 AC 27 ms
7,580 KB
testcase_15 AC 27 ms
7,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::{Read, Write};

fn run() {
    let out = std::io::stdout();
    let mut out = std::io::BufWriter::new(out.lock());
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();
    let mut it = s.trim().split_whitespace();
    let n: usize = it.next().unwrap().parse().unwrap();
    let x: Vec<u32> = (0..n).map(|_| it.next().unwrap().parse().unwrap()).collect();
    let y: Vec<u32> = (0..n).map(|_| it.next().unwrap().parse().unwrap()).collect();
    let len: u32 = (0..n).map(|i| x[i] + y[i]).min().unwrap();
    writeln!(out, "{}", len).ok();
    writeln!(out, "0").ok();
    for i in 0..n {
        writeln!(out, "{}", std::cmp::min(x[i], len)).ok();
    }
    writeln!(out, "{}", len).ok();
}

fn main() {
    run();
}
0