結果

問題 No.1987 Sandglass Inconvenience
ユーザー kuraraberu
提出日時 2022-06-24 22:25:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 778 bytes
コンパイル時間 1,833 ms
コンパイル使用メモリ 173,080 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 18:18:53
合計ジャッジ時間 2,625 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

template<typename T>bool chmax(T &a, const T& b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T &a, const T& b){if(a>b){a=b;return true;}return false;}

int main(){
    ll a,b,c,x;
    cin>>a>>b>>c>>x;
    set<ll> se;
    ll a1=0,b1=0,c1=0;
    se.insert(a);
    se.insert(b);
    se.insert(c);
    rep(i,2)rep(j,2)rep(k,2){
        if(i==0)a1=a;
        else a1=-a;
        if(j==0)b1=b;
        else b1=-b;
        if(k==0)c1=c;
        else c1=-c;
        se.insert(a1+b1+c1);
        se.insert(a1+b1);
        se.insert(a1+c1);
        se.insert(b1+c1);
    }
    if(se.count(x))cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}
0