結果
| 問題 |
No.170 スワップ文字列(Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-21 09:21:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 5,000 ms |
| コード長 | 399 bytes |
| コンパイル時間 | 1,522 ms |
| コンパイル使用メモリ | 169,740 KB |
| 実行使用メモリ | 6,656 KB |
| 最終ジャッジ日時 | 2024-12-23 00:04:45 |
| 合計ジャッジ時間 | 2,427 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
// 想定解: 全探索
#include <bits/stdc++.h>
using namespace std;
template<typename _T> void rc(_T v,_T mn,_T mx){if(v<mn||mx<v){cerr<<"error"<<endl;throw;}}
int main(){
string S; cin >> S;
rc((int)S.size(), 1, 8);
set<string> res;
sort(S.begin(), S.end());
do {
res.insert(S);
} while(next_permutation(S.begin(), S.end()));
cout << res.size()-1 << endl;
}