結果
| 問題 | No.170 スワップ文字列(Easy) |
| コンテスト | |
| ユーザー |
hanorver
|
| 提出日時 | 2016-07-15 21:30:34 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 5,000 ms |
| コード長 | 403 bytes |
| 記録 | |
| コンパイル時間 | 871 ms |
| コンパイル使用メモリ | 94,320 KB |
| 実行使用メモリ | 6,784 KB |
| 最終ジャッジ日時 | 2026-05-29 03:38:23 |
| 合計ジャッジ時間 | 2,498 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <iostream>
#include <string>
#include <set>
#include <algorithm>
int main() {
std::string s;
std::set<std::string> ss;
std::cin >> s;
std::sort(s.begin(), s.end());
do {
ss.insert(s);
} while (std::next_permutation(s.begin(), s.end()));
// 入力文字列Sを除いて作れる文字列の種類を出力するので1引く
std::cout << ss.size() - 1 << std::endl;
return 0;
}
hanorver