結果

問題 No.104 国道
ユーザー latte0119
提出日時 2015-05-02 14:28:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 244 bytes
コンパイル時間 1,179 ms
コンパイル使用メモリ 156,888 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 17:27:58
合計ジャッジ時間 1,997 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |     scanf("%s",str);
      |     ~~~~~^~~~~~~~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
    char str[32];
    scanf("%s",str);
    int pos=1;
    for(int i=0;str[i];i++){
        if(str[i]=='L')pos*=2;
        else pos=pos*2+1;
    }
    printf("%d\n",pos);

    return 0;
}
0