結果

問題 No.104 国道
ユーザー bal4u
提出日時 2019-04-10 18:21:52
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 382 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 28,160 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 20:09:00
合計ジャッジ時間 1,145 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

// yukicoder: No.104 国道
// 2019.4.10 bal4u
// 倍数の計算

#include <stdio.h>

// 文字列の入力 スペース以下の文字で入力終了
void ins(char *s)
{
	do *s = getchar();
	while (*s++ > ' ');
	*--s = 0;
}

char s[35], *p;

int main()
{
	int ans = 1;

	ins(p = s);
	while (*p) {
		ans <<= 1;
		if (*p == 'R') ans++;
		p++;
	}
	printf("%d\n", ans);
	return 0;
}
0