結果

問題 No.442 和と積
ユーザー poopi_poke
提出日時 2016-11-25 23:15:17
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 617 bytes
コンパイル時間 3,072 ms
コンパイル使用メモリ 74,660 KB
実行使用メモリ 41,352 KB
最終ジャッジ日時 2024-11-27 11:22:02
合計ジャッジ時間 6,277 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 2 WA * 2 RE * 14
権限があれば一括ダウンロードができます

ソースコード

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