結果

問題 No.104 国道
ユーザー huffman56huffman56
提出日時 2022-06-28 11:52:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 52 ms / 5,000 ms
コード長 786 bytes
コンパイル時間 3,081 ms
コンパイル使用メモリ 100,236 KB
実行使用メモリ 22,652 KB
最終ジャッジ日時 2023-08-13 09:21:31
合計ジャッジ時間 5,300 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
22,552 KB
testcase_01 AC 52 ms
22,600 KB
testcase_02 AC 50 ms
20,532 KB
testcase_03 AC 50 ms
20,556 KB
testcase_04 AC 51 ms
22,652 KB
testcase_05 AC 52 ms
20,676 KB
testcase_06 AC 51 ms
20,680 KB
testcase_07 AC 52 ms
22,536 KB
testcase_08 AC 51 ms
20,584 KB
testcase_09 AC 51 ms
20,676 KB
testcase_10 AC 50 ms
18,428 KB
testcase_11 AC 50 ms
20,616 KB
testcase_12 AC 50 ms
20,556 KB
testcase_13 AC 51 ms
20,488 KB
testcase_14 AC 51 ms
20,572 KB
testcase_15 AC 50 ms
20,584 KB
testcase_16 AC 51 ms
20,600 KB
testcase_17 AC 50 ms
20,508 KB
testcase_18 AC 51 ms
20,424 KB
testcase_19 AC 50 ms
20,556 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;


namespace yukicoder
{
    class Program
    {
        static void Main()
        {
            var s = Console.ReadLine();
            var cnt = 1;

            for (var i = 0; i < s.Length; i++)
            {
                if (s[i] == 'L')
                {
                    cnt *= 2;
                }
                else
                {
                    cnt = cnt * 2 + 1;
                }
            }

            Console.WriteLine(cnt);

        }
        
    }
}
0