結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー 37zigen37zigen
提出日時 2016-04-01 23:43:14
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 795 bytes
コンパイル時間 6,815 ms
コンパイル使用メモリ 78,968 KB
実行使用メモリ 56,732 KB
最終ジャッジ日時 2024-04-10 08:12:12
合計ジャッジ時間 13,156 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 154 ms
54,836 KB
testcase_02 AC 140 ms
54,612 KB
testcase_03 AC 153 ms
54,864 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 163 ms
54,752 KB
testcase_10 AC 155 ms
54,992 KB
testcase_11 AC 154 ms
55,116 KB
testcase_12 WA -
testcase_13 AC 152 ms
54,948 KB
testcase_14 AC 140 ms
54,484 KB
testcase_15 AC 140 ms
54,608 KB
testcase_16 WA -
testcase_17 AC 151 ms
55,084 KB
testcase_18 AC 153 ms
54,980 KB
testcase_19 WA -
testcase_20 AC 141 ms
54,676 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 164 ms
55,308 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 157 ms
54,796 KB
testcase_32 AC 161 ms
54,980 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 150 ms
54,876 KB
testcase_38 AC 165 ms
54,972 KB
testcase_39 WA -
testcase_40 AC 151 ms
54,976 KB
testcase_41 AC 174 ms
55,020 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 152 ms
55,028 KB
testcase_48 AC 152 ms
55,032 KB
testcase_49 WA -
testcase_50 WA -
権限があれば一括ダウンロードができます

ソースコード

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);
		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){
				System.out.println(lcm+"/"+i);
				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