結果
| 問題 | No.338 アンケート機能 | 
| コンテスト | |
| ユーザー |  fjafjafja | 
| 提出日時 | 2017-09-17 12:45:33 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 666 bytes | 
| コンパイル時間 | 3,523 ms | 
| コンパイル使用メモリ | 77,696 KB | 
| 実行使用メモリ | 41,436 KB | 
| 最終ジャッジ日時 | 2024-11-08 01:51:20 | 
| 合計ジャッジ時間 | 8,803 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 WA * 3 | 
ソースコード
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));
	}
}
            
            
            
        