結果
| 問題 | No.52 よくある文字列の問題 | 
| コンテスト | |
| ユーザー |  dearorange31 | 
| 提出日時 | 2017-09-07 17:56:05 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 457 bytes | 
| コンパイル時間 | 604 ms | 
| コンパイル使用メモリ | 70,772 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-22 05:31:52 | 
| 合計ジャッジ時間 | 1,131 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 11 | 
ソースコード
#include<iostream>
#include<string>
#include<map>
using namespace std;
map<string,int> mp;
int main(){
	string s;
	cin >> s;
	
	int len = s.size();
	
	for(int i = 0;i < (1 << len);i++){
		int front = 0;
		int end = len-1;
		string ts = "";
		
		for(int j = 0;j < len;j++){
			if((i >> j) % 2 == 0){
				ts += s.substr(front,1);
				front++;
			}else{
				ts += s.substr(end,1);
				end--;
			}
		}
		mp[ts] = 0;
	}
	cout << mp.size() << endl;
	return 0;
}
            
            
            
        