結果

問題 No.442 和と積
ユーザー poopi_pokepoopi_poke
提出日時 2016-11-25 23:15:17
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 617 bytes
コンパイル時間 3,413 ms
コンパイル使用メモリ 75,100 KB
実行使用メモリ 56,292 KB
最終ジャッジ日時 2024-05-05 13:32:44
合計ジャッジ時間 7,398 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 138 ms
41,224 KB
testcase_02 AC 128 ms
41,300 KB
testcase_03 RE -
testcase_04 AC 129 ms
41,252 KB
testcase_05 WA -
testcase_06 AC 128 ms
41,312 KB
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.regex.*;
public class A{
	public static void main(String args[]){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int[] d=kakunou(a*b);
		int[] e=kakunou(a+b);
		out_of_loop:
		for(int i=d.length-1; i>=0; i--){
			for(int j=e.length-1; j>=0; j--){
				if(d[i]==e[j]){
					System.out.print(d[i]);
					break out_of_loop;
				}
			}
		}
	}
		
		
		public static int[] kakunou(int c){
			int[] array = new int[c];
		for(int i=1; i<=c/2; i++){
			if(c%i==0){
			array[i-1]=i;
			array[i]=c/i;
			}
		}
		Arrays.sort(array);
		return array;
		}
}

	
0