結果

問題 No.104 国道
ユーザー Grenache
提出日時 2015-09-23 20:02:06
言語 Java
(openjdk 23)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 3,506 ms
コンパイル使用メモリ 74,324 KB
実行使用メモリ 54,124 KB
最終ジャッジ日時 2024-07-19 08:49:59
合計ジャッジ時間 6,148 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder104 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        char[] s = sc.nextLine().toCharArray();
        int ret = 1;
        for (int i = 0; i < s.length; i++) {
        	ret <<= 1;
        	if (s[i] == 'R') {
        		ret |= 1;
        	}
        }

        System.out.println(ret);
        
        sc.close();
    }
}
0