結果
| 問題 | No.2811 Calculation Within Sequence |
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2024-07-19 21:22:12 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 405 bytes |
| 記録 | |
| コンパイル時間 | 2,425 ms |
| コンパイル使用メモリ | 331,236 KB |
| 実行使用メモリ | 338,092 KB |
| 最終ジャッジ日時 | 2026-04-02 18:28:05 |
| 合計ジャッジ時間 | 4,625 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
#include <bits/stdc++.h>
using Int = int64_t;
void Solve() {
Int a, b;
std::cin >> a >> b;
Int x = 0;
while (a--) {
Int t;
std::cin >> t;
x = std::gcd(x, t);
}
Int y = 0;
while (b--) {
Int t;
std::cin >> t;
y = std::gcd(y, t);
}
std::cout << (y % x ? "No\n" : "Yes\n");
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
Solve();
}
risujiroh