結果

問題 No.104 国道
ユーザー chankou0920chankou0920
提出日時 2017-10-13 14:31:27
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 51 ms / 5,000 ms
コード長 366 bytes
コンパイル時間 2,452 ms
コンパイル使用メモリ 101,796 KB
実行使用メモリ 22,596 KB
最終ジャッジ日時 2023-08-11 00:20:18
合計ジャッジ時間 4,320 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
20,544 KB
testcase_01 AC 49 ms
20,440 KB
testcase_02 AC 50 ms
22,596 KB
testcase_03 AC 49 ms
20,416 KB
testcase_04 AC 50 ms
20,368 KB
testcase_05 AC 50 ms
20,472 KB
testcase_06 AC 51 ms
20,356 KB
testcase_07 AC 49 ms
22,516 KB
testcase_08 AC 49 ms
20,336 KB
testcase_09 AC 50 ms
22,504 KB
testcase_10 AC 50 ms
20,540 KB
testcase_11 AC 50 ms
20,552 KB
testcase_12 AC 51 ms
20,452 KB
testcase_13 AC 49 ms
20,408 KB
testcase_14 AC 50 ms
20,412 KB
testcase_15 AC 51 ms
20,420 KB
testcase_16 AC 51 ms
20,432 KB
testcase_17 AC 50 ms
20,388 KB
testcase_18 AC 49 ms
20,424 KB
testcase_19 AC 50 ms
20,416 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Program {
	public static void Main(string[] args) {
		string s = Console.ReadLine();
		char[] c = new char[0];
		if (s != null) {
			c = s.ToCharArray();
		}
		
		int line = 1;
		for (int i = 0; i < c.Length; i++) {
			if (c[i].Equals('L')) {
				line += line;
			} else {
				line += line + 1;
			}
		}
		
		Console.WriteLine(line);
	}
}
0