結果

問題 No.338 アンケート機能
ユーザー fjafjafjafjafjafja
提出日時 2017-09-17 12:47:24
言語 Java19
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 688 bytes
コンパイル時間 3,167 ms
コンパイル使用メモリ 75,160 KB
実行使用メモリ 57,540 KB
最終ジャッジ日時 2023-08-07 20:28:35
合計ジャッジ時間 8,202 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,008 KB
testcase_01 AC 122 ms
55,880 KB
testcase_02 AC 120 ms
56,528 KB
testcase_03 AC 120 ms
55,928 KB
testcase_04 AC 123 ms
56,084 KB
testcase_05 AC 121 ms
55,752 KB
testcase_06 AC 119 ms
55,832 KB
testcase_07 AC 120 ms
55,856 KB
testcase_08 AC 118 ms
55,720 KB
testcase_09 AC 121 ms
55,504 KB
testcase_10 AC 119 ms
56,404 KB
testcase_11 AC 122 ms
55,920 KB
testcase_12 AC 120 ms
55,956 KB
testcase_13 AC 119 ms
55,928 KB
testcase_14 AC 120 ms
57,540 KB
testcase_15 AC 120 ms
55,348 KB
testcase_16 AC 122 ms
55,676 KB
testcase_17 AC 121 ms
55,808 KB
testcase_18 AC 120 ms
55,688 KB
testcase_19 AC 122 ms
55,676 KB
testcase_20 AC 122 ms
55,456 KB
testcase_21 AC 121 ms
55,796 KB
testcase_22 AC 123 ms
55,944 KB
testcase_23 AC 120 ms
55,672 KB
testcase_24 AC 121 ms
55,436 KB
testcase_25 AC 122 ms
53,652 KB
testcase_26 AC 121 ms
55,696 KB
testcase_27 AC 121 ms
55,680 KB
testcase_28 AC 121 ms
55,632 KB
testcase_29 AC 119 ms
55,836 KB
testcase_30 AC 119 ms
55,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

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]==100&&a[1]==0)||(a[0]==0&&a[1]==100)){ans=1;}
		else if(a[0]+a[1]==0){ans=0;}
		else 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