結果
問題 | No.170 スワップ文字列(Easy) |
ユーザー |
![]() |
提出日時 | 2016-05-14 22:31:51 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 372 bytes |
コンパイル時間 | 702 ms |
コンパイル使用メモリ | 89,728 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 03:29:58 |
合計ジャッジ時間 | 1,501 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
import std.stdio, std.string, std.conv; void main(){ int[char] arr; auto input = readln.strip; foreach(s; input){ arr[s]++; } int ans = factrical(input.length.to!int); foreach(i; arr){ ans /= factrical(i); } (ans - 1).writeln; } int factrical(int a){ if(a == 1)return 1; return a * factrical(a-1); }