結果
| 問題 |
No.170 スワップ文字列(Easy)
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2017-08-11 12:04:45 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 559 bytes |
| コンパイル時間 | 920 ms |
| コンパイル使用メモリ | 103,168 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 21:29:00 |
| 合計ジャッジ時間 | 1,807 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 21 |
ソースコード
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.stdio;
import std.string;
import std.range;
int readint() {
return readln.chomp.to!int;
}
int[] readints() {
return readln.split.map!(to!int).array;
}
int fact(int n) {
return n < 2 ? 1 : n * fact(n - 1);
}
int calc(string s) {
int[char] m;
foreach (c; s) {
m[c]++;
}
int n = fact(cast(int) s.length);
foreach (x; m.values) {
n /= x;
}
return n;
}
void main() {
auto s = readln.chomp;
writeln(calc(s));
}
norioc