結果
| 問題 | No.2811 Calculation Within Sequence |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-19 21:23:34 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 399 bytes |
| 記録 | |
| コンパイル時間 | 1,072 ms |
| コンパイル使用メモリ | 209,952 KB |
| 実行使用メモリ | 9,228 KB |
| 最終ジャッジ日時 | 2026-07-05 07:33:49 |
| 合計ジャッジ時間 | 3,732 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N,M; cin >> N >> M;
int g = 0;
while(N--){
int a; cin >> a;
g = gcd(a,g);
}
bool ok = true;
while(M--){
int b; cin >> b;
if(b%g) ok = false;
}
if(ok) cout << "Yes" << endl;
else cout << "No" << endl;
}