結果
| 問題 | No.2811 Calculation Within Sequence |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-20 12:57:58 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 2,000 ms |
| コード長 | 508 bytes |
| 記録 | |
| コンパイル時間 | 1,082 ms |
| コンパイル使用メモリ | 211,984 KB |
| 実行使用メモリ | 9,280 KB |
| 最終ジャッジ日時 | 2026-07-05 07:52:01 |
| 合計ジャッジ時間 | 3,860 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> istream& operator >> (istream& is, vector<T>& vec) {
for(T& x : vec) is >> x;
return is;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int a, b, g = 0;
cin >> a >> b;
vector<int> T(a), S(b);
cin >> T >> S;
for(auto &&v : T) g = gcd(g, v);
for(auto &&v : S) {
if(v % g != 0){
cout << "No\n";
return 0;
}
}
cout << "Yes\n";
}