結果

問題 No.170 スワップ文字列(Easy)
ユーザー Lay_ec
提出日時 2015-03-22 23:26:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 510 bytes
コンパイル時間 1,822 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-29 00:09:56
合計ジャッジ時間 3,085 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>
#include <stack>

using namespace std;

set<string> ss;
string s;

void solve(){
	int n=ss.size();
	for(int i=0;i<s.size()-1;i++){
		swap(s[i],s[i+1]);
		ss.insert(s);
		if(ss.size()!=n) solve();
	}
}

int main()
{
	cin>>s;

	solve();
	cout<<ss.size()-1<<endl;

	return 0;
}
0