結果

問題 No.338 アンケート機能
ユーザー fjafjafjafjafjafja
提出日時 2017-09-17 12:45:33
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 666 bytes
コンパイル時間 3,254 ms
コンパイル使用メモリ 78,544 KB
実行使用メモリ 56,368 KB
最終ジャッジ日時 2024-04-25 14:53:43
合計ジャッジ時間 8,358 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
54,112 KB
testcase_01 AC 131 ms
54,000 KB
testcase_02 AC 132 ms
54,036 KB
testcase_03 AC 131 ms
53,996 KB
testcase_04 AC 128 ms
53,896 KB
testcase_05 WA -
testcase_06 AC 131 ms
54,156 KB
testcase_07 WA -
testcase_08 AC 131 ms
54,164 KB
testcase_09 AC 134 ms
54,340 KB
testcase_10 AC 132 ms
53,988 KB
testcase_11 AC 128 ms
54,224 KB
testcase_12 AC 130 ms
54,372 KB
testcase_13 AC 131 ms
54,080 KB
testcase_14 AC 131 ms
54,508 KB
testcase_15 AC 119 ms
54,032 KB
testcase_16 AC 128 ms
54,188 KB
testcase_17 AC 131 ms
53,944 KB
testcase_18 AC 128 ms
54,148 KB
testcase_19 AC 130 ms
54,224 KB
testcase_20 AC 134 ms
54,276 KB
testcase_21 WA -
testcase_22 AC 131 ms
54,364 KB
testcase_23 AC 134 ms
54,284 KB
testcase_24 AC 130 ms
54,356 KB
testcase_25 AC 134 ms
54,432 KB
testcase_26 AC 133 ms
54,124 KB
testcase_27 AC 137 ms
54,380 KB
testcase_28 AC 137 ms
54,116 KB
testcase_29 AC 136 ms
54,376 KB
testcase_30 AC 122 ms
53,096 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]==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