結果

問題 No.171 スワップ文字列(Med)
ユーザー kou6839kou6839
提出日時 2015-03-22 23:38:20
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 723 bytes
コンパイル時間 2,525 ms
コンパイル使用メモリ 77,724 KB
実行使用メモリ 58,860 KB
最終ジャッジ日時 2023-09-11 09:34:56
合計ジャッジ時間 5,185 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,696 KB
testcase_01 AC 119 ms
56,360 KB
testcase_02 AC 144 ms
56,188 KB
testcase_03 AC 123 ms
55,844 KB
testcase_04 AC 126 ms
55,820 KB
testcase_05 WA -
testcase_06 AC 179 ms
58,160 KB
testcase_07 AC 176 ms
58,400 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 120 ms
55,844 KB
testcase_11 AC 121 ms
56,216 KB
testcase_12 AC 120 ms
55,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String a = sc.next();
		HashMap<Character, Integer> set = new HashMap<>();
		BigInteger ans = new BigInteger("1");
		for(int i=1;i<=a.length();i++){
			ans=ans.multiply(new BigInteger(i+""));
		}
		for(int i=0;i<a.length();i++){
			if(set.get(a.charAt(i))==null) {
				set.put(a.charAt(i),0);
				}
			set.put(a.charAt(i),set.get(a.charAt(i))+1);
		}
		for (Character string : set.keySet()) {
			for(int i=1;i<=set.get(string);i++){
				ans=ans.divide(new BigInteger(i+""));
			}
		}
		System.out.println(ans.mod(new BigInteger("573")).subtract(new BigInteger("1")));
	}
}
0