結果

問題 No.171 スワップ文字列(Med)
ユーザー te-shte-sh
提出日時 2016-09-07 17:09:21
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 639 bytes
コンパイル時間 727 ms
コンパイル使用メモリ 116,476 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-02 21:59:08
合計ジャッジ時間 1,632 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,368 KB
testcase_01 AC 1 ms
4,368 KB
testcase_02 AC 3 ms
4,368 KB
testcase_03 AC 1 ms
4,372 KB
testcase_04 AC 2 ms
4,368 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
4,372 KB
testcase_11 AC 1 ms
4,368 KB
testcase_12 AC 2 ms
4,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.array, std.container, std.range, std.bitmanip;
import std.numeric, std.math, std.bigint, std.random, core.bitop;
import std.string, std.regex, std.conv, std.stdio, std.typecons;

const auto mod = 573;

void main()
{
  auto s = readln.chomp.map!(to!int).array;
  s.sort();
  auto gi = s.group.map!("a[1]").filter!("a > 1").array;

  auto ti = iota(1, s.length + 1).array;
  foreach (g; gi) {
    foreach (h; 1..g + 1) {
      foreach (ref t; ti) {
        if (t % h == 0) {
          t /= h;
          break;
        }
      }
    }
  }

  auto r = 1;
  foreach (t; ti)
    r = (r * t) % mod;

  writeln(r - 1);
}
0