結果

問題 No.3259 C++ → Rust → Python
ユーザー lp_ql
提出日時 2025-09-06 13:04:15
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 11,841 ms
コンパイル使用メモリ 402,800 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-06 13:04:41
合計ジャッジ時間 13,042 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: variable does not need to be mutable
  --> src/main.rs:17:9
   |
17 |     let mut ans: usize = f(r) - f(l);
   |         ----^^^
   |         |
   |         help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

ソースコード

diff #

use proconio::input;
fn main() {
    input!{
        l: usize,
        r: usize,
    }
    let f = |x: usize|{
        let mut res = 0;
        if x > 295{
            res += 1;
        }
        if x > 416{
            res += 1;
        }
        res
    };
    let mut ans: usize = f(r) - f(l);
    println!("{}", ans)
}
0