結果
| 問題 | No.52 よくある文字列の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-09 01:05:57 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 458µs | |
| コード長 | 416 bytes |
| 記録 | |
| コンパイル時間 | 2,156 ms |
| コンパイル使用メモリ | 184,144 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-09 01:06:01 |
| 合計ジャッジ時間 | 2,360 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
string s; cin >> s;
set<string> all;
int n=s.size();
for(int i=0; i<(1<<n); i++){
string now="";
int l=0, r=n-1;
for(int j=0; j<n; j++){
if(i>>j&1) now+=s[l++];
else now+=s[r--];
}
all.insert(now);
}
cout << all.size() << endl;
return 0;
}