結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー 37zigen37zigen
提出日時 2016-04-01 23:47:18
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 890 bytes
コンパイル時間 2,546 ms
コンパイル使用メモリ 79,592 KB
実行使用メモリ 56,436 KB
最終ジャッジ日時 2024-04-10 08:14:34
合計ジャッジ時間 10,866 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 147 ms
55,104 KB
testcase_02 AC 143 ms
54,876 KB
testcase_03 AC 150 ms
54,840 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 141 ms
54,992 KB
testcase_10 AC 138 ms
55,040 KB
testcase_11 AC 141 ms
55,040 KB
testcase_12 WA -
testcase_13 AC 146 ms
54,840 KB
testcase_14 AC 145 ms
54,860 KB
testcase_15 AC 142 ms
54,872 KB
testcase_16 WA -
testcase_17 AC 142 ms
54,884 KB
testcase_18 AC 140 ms
54,888 KB
testcase_19 WA -
testcase_20 AC 143 ms
55,032 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 160 ms
54,628 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 159 ms
54,988 KB
testcase_32 AC 148 ms
54,872 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 144 ms
55,008 KB
testcase_38 AC 163 ms
54,888 KB
testcase_39 WA -
testcase_40 AC 146 ms
54,880 KB
testcase_41 AC 160 ms
54,984 KB
testcase_42 AC 154 ms
54,852 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 130 ms
54,488 KB
testcase_48 AC 145 ms
55,024 KB
testcase_49 AC 147 ms
54,972 KB
testcase_50 AC 143 ms
54,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder356;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int t1=sc.nextInt();
		int t2=sc.nextInt();
		int t3=sc.nextInt();
		int lcm=LCM(t1,t2,t3);
		if(t1==t2&&t2==t3){
			System.out.println(0);
			return;
		}
		int[] d={lcm/t1,lcm/t2,lcm/t3};
		Arrays.sort(d);
		for(int i=d[1]-1;i>=1;i--){
			if(d[0]%i==d[1]%i&&d[1]%i==d[2]%i){
				int aaa=GCD(lcm,i);
				System.out.println(lcm/aaa+"/"+i/aaa);
				return;
			}
		}
	}
	//最小公倍数
	public static int LCM(int t1,int t2,int t3){
		return LCM(LCM(t1,t2),t3);
	}
	public static int LCM(int t1,int t2){
		int a=GCD(t1,t2);
		int tt1=t1/a;
		int tt2=t2/a;
		return tt1*tt2*a;
	}
	public static int GCD(int t1,int t2){
		if(t1<t2){
			int d=t2;
			t2=t1;
			t1=d;
		}
		if(t2==0)return t1;
		return GCD(t2,t1%t2);
	}
}
0