結果

問題 No.72 そろばん Med
ユーザー hitoyozakehitoyozake
提出日時 2018-08-05 15:39:38
言語 Rust
(1.77.0)
結果
TLE  
実行時間 -
コード長 328 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 168,428 KB
実行使用メモリ 6,304 KB
最終ジャッジ日時 2023-10-19 22:05:49
合計ジャッジ時間 13,242 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `x`
 --> Main.rs:5:9
  |
5 |     let x = std::io::stdin().read_line(& mut buf);
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted

ソースコード

diff #

fn read_i64()->i64{

    let mut buf = String::new();

    let x = std::io::stdin().read_line(& mut buf);

    buf.trim().parse::<i64>().unwrap()

}



fn main() {
    let n = read_i64();

    let mut max:i64 = 0;

    for i in 0..n{

        max = std::cmp::max(max, (n-i+ 1)*i + (n-i));
    
    }

    println!("{}", max);

}
0