結果
| 問題 | No.52 よくある文字列の問題 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-08-06 03:03:09 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 5,000 ms | 
| コード長 | 1,339 bytes | 
| コンパイル時間 | 616 ms | 
| コンパイル使用メモリ | 81,028 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-18 13:51:11 | 
| 合計ジャッジ時間 | 1,142 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 11 | 
ソースコード
#include <iostream>
#include <vector>
#include <utility>
#include <set>
#include <list>
using namespace std;
using ll = long long int;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL_INCLUDED_ENVIRONMENT
template <class T> std::ostream& operator<<(std::ostream& o, const std::vector<T>& v) {
  o << "{";
  for (int i = 0; i < (int) v.size(); i++)
    o << (i > 0 ? ", " : "" ) << v[i];
  o << "}";
  return o;
}
template <class T> std::ostream& operator<<(std::ostream& o, const std::list<T>& lst) {
  o << "{";
  for (auto itr = lst.begin(); itr != lst.end(); itr++)
    o << (itr == lst.begin() ? "" : ", " ) << *itr;
  o << "}";
  return o;
}
template <class X, class Y> std::ostream& operator<<(std::ostream& o, const std::pair<X, Y>& p) {
  o << "(" << p.first << ", " << p.second << ")";
  return o;
}
int main() {
  // cin.tie(0);
  // ios::sync_with_stdio(false);
  string s;
  cin >> s;
  set<list<char> > table;
  
  int n = s.size();
  REP(bits, 1 << n) {
    list<char> lst;
    string::iterator l = s.begin();
    string::iterator r = s.end(); r--;
    REP(i, n) {
      if (bits & (1 << i)) {
        lst.push_back(*l);
        l++;
      } else {
        lst.push_back(*r);
        r--;
      }
    }
    // cout << lst << "\n";
    table.insert(lst);
  }
  cout << table.size() << "\n";
  return 0;
}
            
            
            
        