結果
問題 | No.170 スワップ文字列(Easy) |
ユーザー | なお |
提出日時 | 2015-02-21 03:14:57 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 16 ms / 5,000 ms |
コード長 | 462 bytes |
コンパイル時間 | 1,517 ms |
コンパイル使用メモリ | 169,124 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-23 00:04:42 |
合計ジャッジ時間 | 2,554 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;}} #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) int main(){ string S; cin >> S; rc((int)S.size(), 1, 11); set<string> res; sort(S.begin(), S.end()); do { res.insert(S); } while(next_permutation(S.begin(), S.end())); cout << res.size()-1 << endl; }