結果
| 問題 | No.52 よくある文字列の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-02 12:01:52 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 504µs | |
| コード長 | 576 bytes |
| 記録 | |
| コンパイル時間 | 424 ms |
| コンパイル使用メモリ | 92,556 KB |
| 実行使用メモリ | 9,796 KB |
| 最終ジャッジ日時 | 2026-09-02 05:22:10 |
| 合計ジャッジ時間 | 1,807 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
using namespace std;
set<string> deque_strings;
void deque_of_string(string rest, string building){
if(rest == ""){
deque_strings.insert(building);
}else{
building.push_back(rest.back());
deque_of_string(rest.substr(0, rest.size() - 1), building);
building.back() = rest[0];
deque_of_string(rest.substr(1, rest.size()), building);
}
}
int main(){
string S;
cin >> S;
deque_of_string(S, "");
cout << deque_strings.size() << endl;
}