結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー GrenacheGrenache
提出日時 2016-04-01 23:27:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 717 bytes
コンパイル時間 4,307 ms
コンパイル使用メモリ 76,988 KB
実行使用メモリ 41,760 KB
最終ジャッジ日時 2024-04-21 22:41:55
合計ジャッジ時間 12,581 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,396 KB
testcase_01 AC 136 ms
41,196 KB
testcase_02 AC 137 ms
41,512 KB
testcase_03 AC 139 ms
41,308 KB
testcase_04 AC 135 ms
41,284 KB
testcase_05 AC 136 ms
41,444 KB
testcase_06 AC 135 ms
41,332 KB
testcase_07 AC 134 ms
41,208 KB
testcase_08 AC 138 ms
41,424 KB
testcase_09 AC 133 ms
41,456 KB
testcase_10 AC 133 ms
41,592 KB
testcase_11 AC 134 ms
41,252 KB
testcase_12 AC 132 ms
41,580 KB
testcase_13 AC 134 ms
41,420 KB
testcase_14 AC 133 ms
40,960 KB
testcase_15 AC 132 ms
41,728 KB
testcase_16 AC 133 ms
41,236 KB
testcase_17 AC 134 ms
41,100 KB
testcase_18 AC 133 ms
41,496 KB
testcase_19 AC 134 ms
41,548 KB
testcase_20 AC 132 ms
41,120 KB
testcase_21 AC 133 ms
41,136 KB
testcase_22 AC 121 ms
40,352 KB
testcase_23 AC 131 ms
41,284 KB
testcase_24 AC 132 ms
41,248 KB
testcase_25 AC 134 ms
41,364 KB
testcase_26 AC 134 ms
41,424 KB
testcase_27 AC 134 ms
41,376 KB
testcase_28 AC 133 ms
41,464 KB
testcase_29 AC 135 ms
41,256 KB
testcase_30 AC 136 ms
41,760 KB
testcase_31 AC 134 ms
41,468 KB
testcase_32 AC 134 ms
41,184 KB
testcase_33 AC 132 ms
41,172 KB
testcase_34 AC 134 ms
41,216 KB
testcase_35 AC 136 ms
41,296 KB
testcase_36 AC 120 ms
40,284 KB
testcase_37 AC 133 ms
41,284 KB
testcase_38 AC 131 ms
41,276 KB
testcase_39 AC 132 ms
41,164 KB
testcase_40 AC 132 ms
41,484 KB
testcase_41 AC 133 ms
41,300 KB
testcase_42 AC 134 ms
41,092 KB
testcase_43 AC 132 ms
41,316 KB
testcase_44 AC 120 ms
40,088 KB
testcase_45 AC 134 ms
41,256 KB
testcase_46 AC 134 ms
41,412 KB
testcase_47 AC 136 ms
41,392 KB
testcase_48 AC 136 ms
41,044 KB
testcase_49 AC 122 ms
40,216 KB
testcase_50 AC 136 ms
41,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder356 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long t1 = sc.nextInt();
        long t2 = sc.nextInt();
        long t3 = sc.nextInt();

        long tmp1 = (t3 - t2) * t1;
        long tmp2 = (t3 - t1) * t2;
        long tmp3 = (t2 - t1) * t3;

        long gcd = gcd(tmp1, tmp2);
        gcd = gcd(gcd, tmp3);

        long ret1 = t1 * t2 * t3;
        long ret2 = gcd;

        System.out.printf("%d/%d\n", ret1 / gcd(ret1, ret2), ret2 / gcd(ret1, ret2));

        sc.close();
    }

	private static long gcd(long n, long m) {
		if (m == 0) {
			return n;
		} else {
			return gcd(m, n % m);
		}
	}
}
0