結果

問題 No.170 スワップ文字列(Easy)
ユーザー kou6839kou6839
提出日時 2015-03-22 23:33:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 550 bytes
コンパイル時間 2,793 ms
コンパイル使用メモリ 72,196 KB
実行使用メモリ 56,184 KB
最終ジャッジ日時 2023-08-24 16:05:30
合計ジャッジ時間 6,877 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
55,504 KB
testcase_01 AC 114 ms
56,036 KB
testcase_02 AC 114 ms
55,872 KB
testcase_03 AC 115 ms
55,856 KB
testcase_04 AC 115 ms
55,320 KB
testcase_05 AC 115 ms
55,516 KB
testcase_06 AC 115 ms
55,692 KB
testcase_07 AC 115 ms
56,108 KB
testcase_08 AC 117 ms
55,544 KB
testcase_09 AC 115 ms
55,520 KB
testcase_10 AC 116 ms
55,960 KB
testcase_11 AC 115 ms
55,260 KB
testcase_12 AC 115 ms
56,124 KB
testcase_13 AC 116 ms
56,088 KB
testcase_14 AC 115 ms
55,856 KB
testcase_15 AC 116 ms
56,184 KB
testcase_16 AC 115 ms
55,980 KB
testcase_17 AC 115 ms
55,392 KB
testcase_18 AC 115 ms
55,684 KB
testcase_19 AC 116 ms
55,532 KB
testcase_20 AC 115 ms
55,568 KB
testcase_21 AC 114 ms
55,616 KB
testcase_22 AC 116 ms
55,756 KB
testcase_23 AC 116 ms
55,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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<>();
		int waa=1;
		for(int i=1;i<=a.length();i++){
			waa*=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++){
				waa/=i;
			}
		}
		System.out.println(waa-1);
	}
}
0