結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2015-05-25 10:10:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 361 ms |
コンパイル使用メモリ | 59,332 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 08:13:03 |
合計ジャッジ時間 | 969 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
#include<iostream> #include<math.h> #include<string> using namespace std; int main(){ string h; string strs; getline(cin, h); int number = 1; int n = h.size(); for (int i = 0; i < n; i++){ char s = h.at(i); strs = s; if (strs == "L"){ number *= 2; } else{ number = 2*number+1; } } cout << number << endl; return 0; }