結果
| 問題 |
No.170 スワップ文字列(Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-20 16:56:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 429 bytes |
| コンパイル時間 | 698 ms |
| コンパイル使用メモリ | 56,332 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-24 00:58:22 |
| 合計ジャッジ時間 | 1,557 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 21 |
ソースコード
#include<iostream>
#include<string>
#define REP(i,n) for(int i=0;i<n;i++)
#define FACTORIAL(j,n) int ans=1;for(int j=0;j<n;j++){ans*=(n-j);}
using namespace std;
int main() {
string s;
int denom, numer = 1, count[26] = {};
cin >> s;
FACTORIAL(j, s.length())
denom = ans;
REP(i, s.length())
count[s[i] - 'A']++;
REP(i, 26) {
if (count[i]) {
FACTORIAL(j, count[i])
numer *= ans;
}
}
cout << denom / numer;
}