結果

問題 No.546 オンリー・ワン
ユーザー fjafjafjafjafjafja
提出日時 2017-07-16 16:02:37
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 557 bytes
コンパイル時間 3,186 ms
コンパイル使用メモリ 74,772 KB
実行使用メモリ 61,508 KB
最終ジャッジ日時 2024-04-16 22:34:48
合計ジャッジ時間 6,959 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
47,068 KB
testcase_01 AC 123 ms
41,124 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class N546 {

	public static void main(String[] args)
{
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();
		int H=sc.nextInt();
		int[] c=new int[N];
		int count =0;
		int k=0;
		int error=0;
		for(int i=0;i<N;i++)
		{
			c[i]=sc.nextInt();
		}

		for(int i=L;i<=H;i++)
		{	k=0;
			error=0;
			while(error<2)
			{
				if(i%c[k]==0)
				{
					error+=1;
				}
				if(k==N-1&&error==1)
				{
					count+=1;
				}
				error=(k==N-1)?2:error;
				k++;

			}
		}
		System.out.println(count);
	}

}
0