結果
| 問題 | No.170 スワップ文字列(Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-10 17:35:39 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 7 ms / 5,000 ms |
| + 247µs | |
| コード長 | 399 bytes |
| 記録 | |
| コンパイル時間 | 747 ms |
| コンパイル使用メモリ | 100,584 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-28 22:14:53 |
| 合計ジャッジ時間 | 2,307 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main() {
int ans = 0;
string s;
vector<string> tmp;
cin >> s;
sort(s.begin(), s.end());
tmp.push_back(s);
while (next_permutation(s.begin(), s.end())) tmp.push_back(s);
sort(tmp.begin(), tmp.end());
for (size_t i = 1; i < tmp.size(); ++i) if (tmp[i - 1] != tmp[i]) ++ans;
cout << ans;
}