結果

問題 No.171 スワップ文字列(Med)
コンテスト
ユーザー te-sh
提出日時 2016-09-07 17:09:21
言語 D
(dmd 2.112.0)
コンパイル:
dmd -fPIE -m64 -w -wi -O -release -inline -I/opt/dmd/src/druntime/import/ -I/opt/dmd/src/phobos -L-L/opt/dmd/linux/lib64/ -fPIC _filename_
実行:
./Main
結果
WA  
実行時間 -
コード長 639 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 704 ms
コンパイル使用メモリ 105,176 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-05 07:22:28
合計ジャッジ時間 1,319 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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