結果

問題 No.170 スワップ文字列(Easy)
ユーザー k_kadorak_kadora
提出日時 2015-06-14 19:50:06
言語 Java19
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 476 bytes
コンパイル時間 3,154 ms
コンパイル使用メモリ 72,300 KB
実行使用メモリ 56,064 KB
最終ジャッジ日時 2023-08-24 16:21:07
合計ジャッジ時間 7,067 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
53,776 KB
testcase_01 AC 117 ms
55,676 KB
testcase_02 AC 116 ms
55,688 KB
testcase_03 AC 115 ms
55,704 KB
testcase_04 AC 115 ms
55,640 KB
testcase_05 AC 114 ms
55,444 KB
testcase_06 AC 116 ms
55,700 KB
testcase_07 AC 122 ms
55,868 KB
testcase_08 AC 114 ms
56,032 KB
testcase_09 AC 121 ms
55,752 KB
testcase_10 AC 124 ms
55,696 KB
testcase_11 AC 124 ms
55,460 KB
testcase_12 AC 123 ms
55,688 KB
testcase_13 AC 116 ms
55,764 KB
testcase_14 AC 118 ms
55,844 KB
testcase_15 AC 115 ms
55,732 KB
testcase_16 AC 114 ms
55,808 KB
testcase_17 AC 116 ms
55,636 KB
testcase_18 AC 114 ms
56,024 KB
testcase_19 AC 115 ms
55,720 KB
testcase_20 AC 114 ms
55,680 KB
testcase_21 AC 116 ms
56,064 KB
testcase_22 AC 116 ms
55,980 KB
testcase_23 AC 115 ms
55,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Yuki170{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int[] al = new int[26];
		int b=1,res;
		String s = sc.next();
		for(int i = 0;i<s.length();i++){
			al[s.charAt(i) - 'A']++;
		}
		for(int i = 0;i<26;i++){
			if(al[i] != 0){
				b *= Ban(al[i]);
			}
		}
		res = Ban(s.length())/b - 1;
		System.out.println(res);
	}
	public static int Ban(int n){
		if(n == 1)return 1;
		return n * Ban(n-1);
	}
}
0