結果

問題 No.3259 C++ → Rust → Python
ユーザー おもち(求肥)
提出日時 2025-09-06 13:24:49
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 13,216 ms
コンパイル使用メモリ 400,436 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-09-06 13:25:20
合計ジャッジ時間 14,480 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn get_current(n: usize) -> String {
    if n <= 295 {
        "C++".to_string()
    } else if n <= 416 {
        "Rust".to_string()
    } else {
        "Python".to_string()
    }
}

fn main() {
    input!{
        l: usize,
        r: usize
    }
    let mut ans = 0;
    let mut prev = get_current(l);
    for i in l+1..=r {
        let current = get_current(i);
        if current != prev {
            ans += 1;
            prev = current;
        }
    }
    println!("{}", ans);
}
0