結果

問題 No.104 国道
ユーザー Maeda
提出日時 2025-03-07 17:04:07
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 24,704 KB
実行使用メモリ 8,608 KB
最終ジャッジ日時 2025-03-07 17:04:08
合計ジャッジ時間 1,469 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%s",bendStr);
      |         ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

void main(void){
	char bendStr[100] = "a";
	scanf("%s",bendStr);
	int i = 0;
	int nowLane = 1;
	while(bendStr[i] != '\0'){
		if(bendStr[i] == 'L'){
			nowLane = nowLane * 2;
		}else if(bendStr[i] == 'R'){
			nowLane = nowLane * 2 + 1;
		}
		i++;
	}
	
	printf("%d",nowLane);
}
0