結果

問題 No.171 スワップ文字列(Med)
ユーザー saytakaPCsaytakaPC
提出日時 2015-03-23 00:44:51
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 367 bytes
コンパイル時間 1,827 ms
コンパイル使用メモリ 145,236 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-11 09:41:59
合計ジャッジ時間 2,715 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 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,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	int cnt[26],c=1,ans=1;
	cin>>s;
	memset(cnt,0,sizeof(cnt));
	for(int i=0;i<s.size();i++){
		cnt[s[i]-'A']++;
	}
	for(int i=0;i<26;i++){
		if(cnt[i]>0){
			for(int j=1;j<=cnt[i];j++){
				c*=j;
				c%=573;
			}
		}
	}
	for(int i=1;i<=s.size();i++){
		ans*=i;
		ans%=573;
	}
	cout<<ans/c-1<<endl;
}
0