結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2022-04-26 22:35:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 273 bytes |
コンパイル時間 | 642 ms |
コンパイル使用メモリ | 67,028 KB |
最終ジャッジ日時 | 2025-01-28 22:02:12 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
#include <iostream> #include <string> using namespace std; int main() { string S; cin >> S; long long int ans = 1; for( int i = 0; i < S.size(); i++ ) { if( S[i] == 'L' ) { ans = ans*2; } else { ans = ans * 2 + 1; } } cout << ans << endl; return 0; }