結果

問題 No.104 国道
コンテスト
ユーザー rustGanbaruman
提出日時 2026-02-05 19:30:09
言語 Rust
(1.92.0 + proconio + num + itertools)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 330 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,067 ms
コンパイル使用メモリ 192,168 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-02-05 19:30:13
合計ジャッジ時間 2,425 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

fn main(){
    let mut lr = String::new();
    io::stdin().read_to_string(&mut lr).unwrap();

    
    let mut number = 1;
    for i in lr.chars(){
        if i == 'L'{
            number *= 2
        }else if i == 'R'{
            number = number * 2 + 1;
        }
    }
    println!("{}",number)
}

0