結果

問題 No.104 国道
ユーザー hanorver
提出日時 2015-09-01 21:44:23
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 282 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 54,772 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 17:31:08
合計ジャッジ時間 1,032 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>

int main() {
	std::string str;

	std::getline(std::cin, str);

	int road = 1;
	for (int i = 0; i < str.length(); i++) {
		if (str[i] == 'L') {
			road *= 2;
		} else {
			road = road * 2 + 1;
		}
	}

	std::cout << road << std::endl;
	return 0;
}
0