結果

問題 No.1987 Sandglass Inconvenience
ユーザー polyester
提出日時 2022-06-24 22:30:35
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 730 bytes
コンパイル時間 2,439 ms
コンパイル使用メモリ 140,404 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 18:26:41
合計ジャッジ時間 3,377 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
  ll a, b, c, x;
  cin >> a >> b >> c >> x;
  ll A[3] = {-a, 0, a};
  ll B[3] = {-b, 0, b};
  ll C[3] = {-c, 0, c};
  for(int i = 0; i < 3; i++) {
    for(int j = 0; j < 3; j++) {
      for(int k = 0; k < 3; k++) {
        ll num = A[i] + B[j] + C[k];
        if(num == 0) {
          continue;
        }
        if(x % num == 0) {
          cout << "Yes\n";
          return 0;
        }
      }
    }
  }
  cout << "No\n";
  return 0;
}
0