結果

問題 No.104 国道
ユーザー r.suzuki
提出日時 2016-01-09 20:57:02
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 339 bytes
コンパイル時間 2,997 ms
コンパイル使用メモリ 74,812 KB
実行使用メモリ 41,356 KB
最終ジャッジ日時 2024-09-19 13:18:49
合計ジャッジ時間 6,009 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

public class No_104 {

	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		char[] LorR = sc.next().toCharArray();
		int root = 1;

		for (char c : LorR) {
			if (c == 'L')
				root *= 2;
			else if (c == 'R')
				root = root * 2 + 1;
		}

		System.out.println(root);
		sc.close();

	}

}
0