結果

問題 No.338 アンケート機能
ユーザー fjafjafjafjafjafja
提出日時 2017-09-17 12:37:10
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 3,262 ms
コンパイル使用メモリ 75,048 KB
実行使用メモリ 54,956 KB
最終ジャッジ日時 2024-04-25 14:53:28
合計ジャッジ時間 7,999 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
54,012 KB
testcase_01 AC 132 ms
54,472 KB
testcase_02 AC 127 ms
54,336 KB
testcase_03 AC 122 ms
54,100 KB
testcase_04 WA -
testcase_05 AC 106 ms
53,024 KB
testcase_06 WA -
testcase_07 AC 114 ms
54,260 KB
testcase_08 AC 119 ms
54,148 KB
testcase_09 AC 120 ms
54,328 KB
testcase_10 AC 119 ms
54,064 KB
testcase_11 AC 114 ms
53,116 KB
testcase_12 AC 118 ms
54,024 KB
testcase_13 AC 114 ms
54,100 KB
testcase_14 AC 115 ms
53,100 KB
testcase_15 AC 108 ms
53,184 KB
testcase_16 AC 118 ms
54,448 KB
testcase_17 AC 118 ms
54,196 KB
testcase_18 AC 122 ms
54,048 KB
testcase_19 AC 106 ms
53,032 KB
testcase_20 AC 121 ms
54,480 KB
testcase_21 AC 108 ms
53,364 KB
testcase_22 AC 118 ms
54,364 KB
testcase_23 AC 118 ms
53,932 KB
testcase_24 AC 108 ms
54,956 KB
testcase_25 AC 120 ms
53,924 KB
testcase_26 AC 118 ms
53,980 KB
testcase_27 AC 105 ms
53,308 KB
testcase_28 AC 104 ms
53,148 KB
testcase_29 AC 114 ms
54,272 KB
testcase_30 AC 105 ms
53,180 KB
権限があれば一括ダウンロードができます

ソースコード

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