結果

問題 No.104 国道
ユーザー nak2yoshi
提出日時 2016-02-19 16:05:38
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 318 bytes
コンパイル時間 694 ms
コンパイル使用メモリ 95,744 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-12 02:56:52
合計ジャッジ時間 1,432 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio,
       std.conv,
       std.string,
       std.range,
       std.math,
       std.algorithm;

void main()
{
    auto S = readln.strip;

    auto ans = 1;
    foreach (i, e; S)
    {
        if (e == 'L')
            ans = ans * 2;
        else
            ans = ans * 2 + 1;
    }
    ans.writeln;
}
0