結果

問題 No.104 国道
ユーザー sk3388607083sk3388607083
提出日時 2018-06-21 19:33:06
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 343 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 25,448 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-13 07:36:45
合計ジャッジ時間 3,406 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 WA -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 2 ms
4,380 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>

int beki2(int n){
  int i, re = 1;
  for(i = 0; i < n; i++) re *= 2;
  return re;
}
int main(void){
  int i, n = 0;
  char S[30];
  int sum;
  scanf("%s", S);
  while(S[n] != '\0') n++;
  sum = beki2(n);

  for(i = 0; S[i] != '\n'; i++){
    if(S[i] == 'R') sum += beki2(n - 1 - i);
  }
  printf("%d\n", sum);
  return 0;
}
0