結果
問題 | No.1987 Sandglass Inconvenience |
ユーザー |
![]() |
提出日時 | 2022-06-25 01:58:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 589 bytes |
コンパイル時間 | 410 ms |
コンパイル使用メモリ | 40,516 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 20:27:15 |
合計ジャッジ時間 | 1,100 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
/* -*- coding: utf-8 -*-** 1987.cc: No.1987 Sandglass Inconvenience - yukicoder*/#include<cstdio>#include<algorithm>using namespace std;/* constant *//* typedef */typedef long long ll;/* global variables */template <typename T>T gcd(T m, T n) { // m >= 0, n >= 0if (m < n) swap(m, n);while (n > 0) {T r = m % n;m = n;n = r;}return m;}/* subroutines *//* main */int main() {ll a, b, c, x;scanf("%lld%lld%lld%lld", &a, &b, &c, &x);ll g = gcd(gcd(a, b), c);if (x % g == 0) puts("Yes");else puts("No");return 0;}