結果
問題 |
No.2682 Visible Divisible
|
ユーザー |
![]() |
提出日時 | 2024-03-21 00:31:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 95 ms / 2,000 ms |
コード長 | 393 bytes |
コンパイル時間 | 2,031 ms |
コンパイル使用メモリ | 195,408 KB |
最終ジャッジ日時 | 2025-02-20 10:19:08 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); int n; long long k; cin >> n >> k; vector<long long> a(n); long long l = 1; for (int i = 0; i < n; i++) { cin >> a[i]; l = lcm(l, gcd(k, a[i])); } cout << (l == k ? "Yes" : "No") << endl; }