結果
| 問題 |
No.170 スワップ文字列(Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-07 10:28:39 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 352 bytes |
| コンパイル時間 | 731 ms |
| コンパイル使用メモリ | 94,464 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-12 06:56:11 |
| 合計ジャッジ時間 | 1,367 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string;
void main()
{
auto s = readln.chomp;
auto fi = new int[](s.length + 1);
fi[0] = 1;
foreach (i; 1..fi.length) fi[i] = i.to!int * fi[i - 1];
auto hi = new int[](26);
foreach (c; s) ++hi[c - 'A'];
auto r = fi[s.length];
foreach (h; hi) r /= fi[h];
writeln(r - 1);
}