結果
| 問題 |
No.104 国道
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-09 18:06:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 484 bytes |
| コンパイル時間 | 109 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-06-27 10:44:22 |
| 合計ジャッジ時間 | 1,451 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 16 |
ソースコード
def find_road_number(S):
current_road = 1
increment = 1
for direction in S:
if direction == 'L':
current_road += increment
else: # direction == 'R'
current_road += increment + 1
increment = increment * 2
return current_road
# input関数を使ってユーザーからの入力を受け取る
S = input("分岐の方向を入力してください(例:LR): ").strip()
# 結果を出力
print(find_road_number(S))