結果

問題 No.170 スワップ文字列(Easy)
ユーザー hanorver
提出日時 2016-07-15 21:30:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 403 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 79,716 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-23 00:42:21
合計ジャッジ時間 1,603 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0