結果

問題 No.104 国道
ユーザー hiyori
提出日時 2017-07-14 20:56:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 289 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 65,264 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-07 21:54:10
合計ジャッジ時間 1,097 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>

using namespace std;

int main(){
    string s;
    cin >> s;
    int n=1;
    for(int i=0; i<s.length(); i++) {
        if(s[i] == 'L') { n = n*2; }
        else if(s[i]=='R') { n = n*2+1; }
        else {}
    }
    cout << n << endl;
    return 0;
}
0