結果
| 問題 | No.170 スワップ文字列(Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-17 10:05:58 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 10 ms / 5,000 ms |
| + 853µs | |
| コード長 | 438 bytes |
| 記録 | |
| コンパイル時間 | 495 ms |
| コンパイル使用メモリ | 98,520 KB |
| 実行使用メモリ | 9,860 KB |
| 最終ジャッジ日時 | 2026-10-06 06:19:55 |
| 合計ジャッジ時間 | 2,171 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
int main(){
string s;
cin>>s;
vector<char> v;
for(int i=0; i<s.size(); ++i){
v.push_back(s[i]);
}
sort(v.begin(),v.end());
set<string> se;
do{
string s2;
for(int i=0; i<s.size(); ++i){
s2+=v[i];
}
se.insert(s2);
} while(next_permutation(v.begin(),v.end()));
cout<<se.size()-1<<endl;
return 0;
}