結果
| 問題 | No.170 スワップ文字列(Easy) | 
| コンテスト | |
| ユーザー |  kou6839 | 
| 提出日時 | 2015-03-22 23:33:54 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 123 ms / 5,000 ms | 
| コード長 | 550 bytes | 
| コンパイル時間 | 2,337 ms | 
| コンパイル使用メモリ | 76,148 KB | 
| 実行使用メモリ | 41,108 KB | 
| 最終ジャッジ日時 | 2024-12-23 00:15:12 | 
| 合計ジャッジ時間 | 5,547 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
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);
	}
}
            
            
            
        