結果

問題 No.546 オンリー・ワン
ユーザー hiyokko2
提出日時 2017-07-29 17:18:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 521 bytes
コンパイル時間 2,540 ms
コンパイル使用メモリ 158,256 KB
実行使用メモリ 13,640 KB
最終ジャッジ日時 2024-10-10 19:26:26
合計ジャッジ時間 5,316 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 TLE * 1 -- * 1
other -- * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
//#define int long long
using namespace std;
typedef long long ll;
typedef vector<vector<ll>> mat;
const int INF = 1e9;



signed main()
{
    int N, L, H;
    int C[15];

    cin >> N >> L >> H;
    REP(i,N) cin >> C[i];

    int ans = 0;
    for (int i=L; i<=H; i++) {
        int cnt = 0;
        REP(j,N) if (i % C[j] == 0) cnt++;
        if (cnt == 1) ans++;
    }

    cout << ans << endl;
}
0