結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
newlife171128
|
| 提出日時 | 2018-01-26 21:28:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 941 bytes |
| コンパイル時間 | 2,842 ms |
| コンパイル使用メモリ | 166,908 KB |
| 実行使用メモリ | 60,032 KB |
| 最終ジャッジ日時 | 2024-12-28 00:08:18 |
| 合計ジャッジ時間 | 4,063 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 8 |
ソースコード
#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