結果

問題 No.104 国道
ユーザー shimashima_k
提出日時 2015-04-26 18:12:54
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 58,884 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-05 02:50:19
合計ジャッジ時間 1,229 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 3
other WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "iostream"
#include "algorithm"
using namespace std;

int main() {
    string a;
    int ans =1;
    cin >> a;
    for (int i = 0; i < a.length(); ++i) {
        cout<<"A: " << ans<<endl;
        if (a[i] == 'R') {
            ans = ans *2 + 1;
        }else {
            ans *= 2;
        }
    }
    cout<<ans<<endl;
    return 0;
}
0