結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
古寺いろは
|
| 提出日時 | 2015-04-13 23:48:42 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 407 bytes |
| コンパイル時間 | 1,316 ms |
| コンパイル使用メモリ | 167,264 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 05:20:31 |
| 合計ジャッジ時間 | 1,861 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main(){
string st;
cin >> st;
int N = st.size();
set<string> se;
for (int i = 0; i < (1 << (N - 1)); i++)
{
string temp = "";
int s = 0;
int t = N - 1;
for (int j = 0; j < N - 1; j++)
{
if ((i >> j) % 2){
temp += st[s++];
}
else{
temp += st[t--];
}
}
temp += st[s];
se.insert(temp);
}
cout << se.size() << endl;
}
古寺いろは