結果

問題 No.546 オンリー・ワン
ユーザー fjafjafjafjafjafja
提出日時 2017-07-16 02:12:18
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 541 bytes
コンパイル時間 3,747 ms
コンパイル使用メモリ 74,380 KB
実行使用メモリ 47,208 KB
最終ジャッジ日時 2024-04-16 21:56:12
合計ジャッジ時間 7,033 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
47,208 KB
testcase_01 AC 110 ms
41,560 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;
		for(int i=0;i<N;i++)
		{
			c[i]=sc.nextInt();
		}

		for(int i=L;i<=H;i++)
		{	int k=0;
			int 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