結果

問題 No.170 スワップ文字列(Easy)
ユーザー やまぞう
提出日時 2015-03-29 02:16:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 870 ms
コンパイル使用メモリ 59,740 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-03 22:32:26
合計ジャッジ時間 1,461 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int fact(int n)
{
	int result = 1;
	for (int i = 2; i <= n; i++) {
		result *= i;
	}
	return result;
}

int main(int argc, char **argv)
{
	string S;
	cin >> S;
	
	vector<int> V(26);
	for (char ch : S) V[ch - 'A']++;

	int result = fact(S.length());
	for (int n : V) result /= fact(n);

	cout << result << endl;
}
0