結果
問題 | No.1987 Sandglass Inconvenience |
ユーザー |
|
提出日時 | 2022-06-25 15:46:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 442 bytes |
コンパイル時間 | 1,871 ms |
コンパイル使用メモリ | 196,508 KB |
最終ジャッジ日時 | 2025-01-30 00:47:56 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include<bits/stdc++.h>using namespace std;const long long mod=1e9+7;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);long long A,B,C,X;cin>>A>>B>>C>>X;vector<long long>G;G.push_back(gcd(A,B));G.push_back(gcd(C,B));G.push_back(gcd(A,C));G.push_back(gcd(A+B,C));G.push_back(gcd(A+C,B));G.push_back(gcd(C+B,A));bool yes=false;for(int i=0;i<6;i++)yes|=(X%G[i]==0);cout<<(yes?"Yes\n":"No\n");}