結果
| 問題 |
No.104 国道
|
| コンテスト | |
| ユーザー |
kekenx
|
| 提出日時 | 2020-03-06 10:20:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 329 bytes |
| コンパイル時間 | 1,527 ms |
| コンパイル使用メモリ | 165,680 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 02:41:04 |
| 合計ジャッジ時間 | 2,363 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef pair<P, P> P2;
int main() {
string s;
cin >> s;
int n = s.size();
int ans = 1;
for (int i = 0; i < n; ++i) {
if (s[i] == 'L') {
ans *= 2;
} else {
ans *= 2;
ans++;
}
}
cout << ans << '\n';
return 0;
}
kekenx