結果

問題 No.104 国道
コンテスト
ユーザー tsuishi
提出日時 2022-08-02 16:17:48
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 604 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 173 ms
コンパイル使用メモリ 39,104 KB
最終ジャッジ日時 2026-02-22 09:24:29
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
// Yukicoder №104 国道
// https://yukicoder.me/problems/no/104
// ***********************
static char *GETWORD( char* str );
static char *GETWORD(char* str) {char c;char *cp;cp=&str[0];c=getchar_unlocked();while( c != EOF ){if((c==' ')||( c=='\n')) break;*cp++=c;c=getchar_unlocked();}*cp='\0';return &str[0];}
#define INPBUF (30+2)

// ***********************
// 外部変数
// ***********************
int main() {

	char	str[INPBUF];
	long		rt=1;
	char *p;

	p = str;
	GETWORD(p);
	while(*p !='\0') {
		rt *= 2;
		if(*p == 'R') rt++;
		++p;
	}
	printf("%ld\n",rt);
	return 0;
}
0