結果
| 問題 |
No.104 国道
|
| コンテスト | |
| ユーザー |
Fre_de_rica
|
| 提出日時 | 2019-03-08 16:27:32 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 595 bytes |
| コンパイル時間 | 115 ms |
| コンパイル使用メモリ | 29,440 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-23 15:02:50 |
| 合計ジャッジ時間 | 818 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
#include <stdio.h>
#include <string.h>
int main(void){
int current_root = 1;
char root_hist[31];
char *p;
scanf("%s", root_hist);
p = root_hist;
while(*p != '\0'){
if(*p == 'L'){
current_root = current_root*2;
}
if(*p == 'R'){
current_root = current_root*2+1;
}
/* debug
if(current_root == 114){
printf("514");
}
if(current_root == 810){
printf("1919");
}
*/
p++;
}
printf("%d\n", current_root);
}
Fre_de_rica