結果
| 問題 |
No.1987 Sandglass Inconvenience
|
| コンテスト | |
| ユーザー |
hiro71687k
|
| 提出日時 | 2023-04-13 07:26:28 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 2,000 ms |
| コード長 | 544 bytes |
| コンパイル時間 | 3,816 ms |
| コンパイル使用メモリ | 251,428 KB |
| 最終ジャッジ日時 | 2025-02-12 05:30:21 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll inf=144494;
ll mod=1000000007;
ll gcd(ll a, ll b) {
a = abs(a); b = abs(b);
if (a < b)swap(a, b);
while (b) {
ll r=a%b;
a=b;
b=r;
}
return a;
}
int main(){
ll a,b,c;
cin >> a >> b >> c;
a=gcd(a,b);
a=gcd(a,c);
ll x;
cin >> x;
if (x%a==0)
{
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
}
hiro71687k