結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
newlife171128
|
| 提出日時 | 2018-01-26 21:29:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 947 bytes |
| コンパイル時間 | 3,271 ms |
| コンパイル使用メモリ | 166,628 KB |
| 実行使用メモリ | 88,576 KB |
| 最終ジャッジ日時 | 2024-12-28 00:19:44 |
| 合計ジャッジ時間 | 4,932 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 5 |
ソースコード
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cmath>
#include <stack>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>
#include <string.h>
#include <utility>
typedef long long ll;
using namespace std;
typedef pair<int, int> P;
int main() {
string s;
cin>>s;
string sf =s.substr(1);
string sb =s.substr(0,s.size()-1);
set<string> a_set,b_set;
do{
a_set.insert(sf);
}while(next_permutation(sf.begin(),sf.end()));
do{
b_set.insert(sb);
}while(next_permutation(sb.begin(),sb.end()));
set<string>::iterator itr;
for(itr = a_set.begin(); itr != a_set.end(); ++itr) {
/* std::cout << *itr << "\n";*/
b_set.insert(*itr);
}
/*
for(itr = b_set.begin(); itr != b_set.end(); ++itr) {
std::cout << *itr << "\n";
}
*/
cout<<b_set.size()<<endl;
return 0;
}
newlife171128