結果

問題 No.1987 Sandglass Inconvenience
ユーザー kuraraberukuraraberu
提出日時 2022-06-24 22:25:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 778 bytes
コンパイル時間 1,749 ms
コンパイル使用メモリ 170,388 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 05:33:07
合計ジャッジ時間 2,390 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 1 ms
6,944 KB
testcase_16 WA -
testcase_17 AC 2 ms
6,940 KB
testcase_18 WA -
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

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