結果

問題 No.104 国道
ユーザー yamaken1343
提出日時 2015-11-20 21:57:22
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 209 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 20,864 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-13 17:05:40
合計ジャッジ時間 839 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%s",s);
      |         ^~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<string.h>
int main(void){
	int a,b,c;
	char s[31];
	
	scanf("%s",s);
	b=1;
	for(a=0;a<strlen(s);a++){
		if(s[a] == 'L') b = 2*b;
		else b = 2*b +1;
	}
	printf("%d\n",b);
	return 0;
}
0