結果

問題 No.104 国道
ユーザー KUSAKA Gen
提出日時 2018-02-25 16:21:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 253 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 56,240 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-14 12:53:17
合計ジャッジ時間 1,275 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

int main()
{
	string S;
	cin >> S;
	int answer = 1;

	for(int i = 0; i < S.length(); ++i)
	{
		answer = ((S[i] == 'L') ? answer * 2 : answer * 2 + 1);
	}

	cout << answer << endl;

	return 0;
}
0