結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2018-11-08 00:04:36 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 5,000 ms |
コード長 | 692 bytes |
コンパイル時間 | 1,146 ms |
コンパイル使用メモリ | 107,788 KB |
実行使用メモリ | 25,796 KB |
最終ジャッジ日時 | 2024-11-20 20:54:16 |
合計ジャッジ時間 | 2,478 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; class Program { static void Main(string[] args) { //入力 string s = Console.ReadLine(); char[] t = new char[s.Length]; for (int i = 0; i < s.Length; i++) { t[i] = s[i]; } //現在通っている未知の番号 int road_num = 1; //はじめは1にいる //Lが出たら2倍、Rが出たら2倍+1にする for (int i = 0; i < s.Length; i++) { if (t[i] == 'L') { road_num = road_num * 2; } else if (t[i] == 'R') { road_num = road_num * 2 + 1; } } //出力 Console.WriteLine(road_num); } }