結果

問題 No.171 スワップ文字列(Med)
ユーザー TwizzTwizz
提出日時 2017-05-17 09:12:06
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 613 bytes
コンパイル時間 2,500 ms
コンパイル使用メモリ 160,764 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 14:39:29
合計ジャッジ時間 3,099 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 RE -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 WA -
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include"bits/stdc++.h"
#include<fstream>
#include<random>

//#include<bits/stdc++.h>
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
typedef long long ll;
const ll mod = 573;

#define pi 3.141592
string s;

ll ex(int n) {
	if (n == 1)return 1;
	return n*ex(n - 1)%mod;
}

int main() {
	cin >> s;
	ll count[26] = {};
	int n = s.size();
	rep(i, 0, n) {
		rep(j, 0, 26) {
			if (j == s[i] - 'A') {
				count[j]++;
			}
		}
	}
	ll ch = ex(n)%mod;
	rep(i, 0, 26) {
		if(count[i]>1)ch /= ex(count[i])%mod;
	}
	print(ch%mod-1);

	//rep(i, 0, 26)print(count[i]);
	return 0;
}
0