結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー nebukuro09
提出日時 2017-03-09 20:17:00
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 559 bytes
コンパイル時間 880 ms
コンパイル使用メモリ 120,320 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-12 07:16:18
合計ジャッジ時間 2,151 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 48
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/std/numeric.d(2999): Warning: cannot inline function `std.numeric.gcdImpl!ulong.gcdImpl`

ソースコード

diff #

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


void main() {
    auto s = 3.iota.map!(_ => readln.chomp.to!long).array.sort();
    auto t1 = s[0];
    auto t2 = s[1];
    auto t3 = s[2];

    auto a = (t3 - t1) * t1 * t2;
    auto b = (t2 - t1) * t1 * t3;
    auto c = gcd(a, b);
    a /= c;
    b /= c;

    auto d = t1 * t2 * b;
    auto e = t2 - t1;
    auto f = gcd(d, e);
    writeln(d/f, "/", e/f);

}
0