結果
問題 |
No.546 オンリー・ワン
|
ユーザー |
![]() |
提出日時 | 2017-07-16 02:12:18 |
言語 | Java (openjdk 23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 541 bytes |
コンパイル時間 | 3,711 ms |
コンパイル使用メモリ | 78,212 KB |
実行使用メモリ | 61,148 KB |
最終ジャッジ日時 | 2024-10-08 02:45:44 |
合計ジャッジ時間 | 7,830 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 TLE * 1 -- * 1 |
other | -- * 7 |
ソースコード
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); } }