結果
| 問題 | 
                            No.104 国道
                             | 
                    
| コンテスト | |
| ユーザー | 
                             TLwiegehtt
                         | 
                    
| 提出日時 | 2015-07-07 07:24:10 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 317 bytes | 
| コンパイル時間 | 223 ms | 
| コンパイル使用メモリ | 21,120 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-08 01:28:46 | 
| 合計ジャッジ時間 | 937 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 16 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         fgets(s, sizeof(s), stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
#include <string.h>
int main(void){
	int i, len;
	int road = 1;
	char s[100];
	fgets(s, sizeof(s), stdin);
	len = strlen(s);
	for(i=0;i<len;i++){
		if(s[i] == 'L'){
			road = road * 2;
		}else if(s[i] == 'R'){
			road = road * 2 + 1;
		}else{
			break;
		}
	}
	
	printf("%d\n", road);
	return 0;
}
            
            
            
        
            
TLwiegehtt