結果

問題 No.171 スワップ文字列(Med)
ユーザー kou6839kou6839
提出日時 2015-03-22 23:47:35
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 614 bytes
コンパイル時間 2,188 ms
コンパイル使用メモリ 75,888 KB
実行使用メモリ 58,336 KB
最終ジャッジ日時 2023-09-11 09:37:09
合計ジャッジ時間 4,783 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,800 KB
testcase_01 AC 122 ms
55,824 KB
testcase_02 AC 147 ms
55,796 KB
testcase_03 AC 123 ms
55,500 KB
testcase_04 AC 124 ms
55,956 KB
testcase_05 WA -
testcase_06 AC 147 ms
55,880 KB
testcase_07 AC 142 ms
55,636 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 120 ms
55,788 KB
testcase_11 AC 117 ms
55,612 KB
testcase_12 AC 119 ms
55,836 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=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);
			ans=ans.multiply(new BigInteger(i+1+""));
			ans=ans.divide(new BigInteger(set.get(a.charAt(i))+""));
		}
		System.out.println(ans.mod(new BigInteger("573")).subtract(new BigInteger("1")));
	}
}
0