結果

問題 No.338 アンケート機能
ユーザー fjafjafja
提出日時 2017-09-17 12:37:10
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 4,377 ms
コンパイル使用メモリ 75,288 KB
実行使用メモリ 41,620 KB
最終ジャッジ日時 2024-11-08 01:51:05
合計ジャッジ時間 8,958 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class N338
{
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		int[] a=new int[2];a[0]=sc.nextInt();a[1]=sc.nextInt();
		double ans=2;
		int end=0;
		if(a[0]==a[1]){}
		else
		{
			Arrays.sort(a);
			while(true)
			{
				for(int i=1;i<=ans/2;i++)
				{
					if(a[0]==Math.round(100.0*((double)i)/ans)&&a[1]==Math.round(100.0*(ans-((double)i))/ans))
					{
						end=1;
						break;
					}
				}
				if(end==1){break;}
				ans++;
			}
		}
		System.out.println(Math.round(ans));
	}

}
0