結果
問題 | No.171 スワップ文字列(Med) |
ユーザー |
![]() |
提出日時 | 2015-03-23 00:13:33 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 166 ms / 1,000 ms |
コード長 | 691 bytes |
コンパイル時間 | 3,660 ms |
コンパイル使用メモリ | 77,500 KB |
実行使用メモリ | 43,748 KB |
最終ジャッジ日時 | 2024-06-29 00:18:34 |
合計ジャッジ時間 | 5,967 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
import java.math.*;import java.util.*;public class yuki170{public static void main (String[] argv){Scanner sc = new Scanner(System.in);String s = sc.next();int num[]=new int[26];for(int i=0;i<26;i++) num[i]=0;for(int i=0;i<s.length();i++){num[s.charAt(i)-'A']++;}BigInteger div = BigInteger.ONE;for(int i=0;i<26;i++){for(int j=num[i];j>0;j--) div=div.multiply(new BigInteger(String.valueOf(j)));}BigInteger res = BigInteger.ONE;for(int j=s.length();j>0;j--) res=res.multiply(new BigInteger(String.valueOf(j)));res=res.divide(div);res=res.subtract(BigInteger.ONE);res=res.mod(new BigInteger("573"));System.out.println(res);}}