結果

問題 No.104 国道
ユーザー LayCurseLayCurse
提出日時 2014-12-16 23:54:50
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 605 bytes
コンパイル時間 1,292 ms
コンパイル使用メモリ 157,672 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 22:03:40
合計ジャッジ時間 2,022 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

#define mygc(c) (c)=getchar_unlocked()
#define mypc(c) putchar_unlocked(c)

void writer(int x, char c){int s=0,m=0;char f[10];if(x<0)m=1,x=-x;while(x)f[s++]=x%10,x/=10;if(!s)f[s++]=0;if(m)mypc('-');while(s--)mypc(f[s]+'0');mypc(c);}
template<class T> void writerLn(T x){writer(x,'\n');}

int main(){
  int i;
  int res = 1;

  for(;;){
    mygc(i);
    if(i==EOF) break;
    if(i=='L') res *= 2;
    if(i=='R') res = res * 2 + 1;
  }
  writerLn(res);
  
  return 0;
}
0