結果
| 問題 | No.52 よくある文字列の問題 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-08-18 23:51:48 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 5,000 ms | 
| コード長 | 344 bytes | 
| コンパイル時間 | 2,259 ms | 
| コンパイル使用メモリ | 197,916 KB | 
| 最終ジャッジ日時 | 2025-01-13 03:33:12 | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 11 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	string s; cin>>s;
	set<string>st;
	for(int i=0,lim=s.size()-1;i<(1<<lim);++i){
		string res;
		int L=0,R=lim;
		for(int j=0;j<=lim;++j){
			if(i&(1<<j))res+=s.at(L++);
			else res+=s.at(R--);
		}
		st.insert(res);
	}
	cout<<st.size()<<"\n"s;
}
            
            
            
        