結果
| 問題 |
No.171 スワップ文字列(Med)
|
| コンテスト | |
| ユーザー |
kou6839
|
| 提出日時 | 2015-03-22 23:38:20 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 723 bytes |
| コンパイル時間 | 2,824 ms |
| コンパイル使用メモリ | 86,596 KB |
| 実行使用メモリ | 56,936 KB |
| 最終ジャッジ日時 | 2024-06-29 00:13:33 |
| 合計ジャッジ時間 | 4,306 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 3 |
ソースコード
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")));
}
}
kou6839