結果

問題 No.546 オンリー・ワン
ユーザー masa_masa0128masa_masa0128
提出日時 2017-08-09 11:14:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 468 bytes
コンパイル時間 747 ms
コンパイル使用メモリ 75,776 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-20 08:30:32
合計ジャッジ時間 4,327 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int main(void){

  int N, H, L;
  int count = 0;
  
  cin >> N >> L >> H;

  vector<int> C;
  for (int i = 0; i < N; i++){
    int x;
    cin >> x;
    C.push_back(x);
  }

  for (int i = L; i < H+1; i++) {
    int flag = 0;
    for (int j = 0; j < N; j++) {
      if (i%C[j] == 0) {
        flag += 1;
      }
    }
    if (flag == 1) {
      count += 1;
    }
  }

  cout << count << endl;

  return 0;
}
0