結果

問題 No.431 死亡フラグ
ユーザー GeckoCPPSonataGeckoCPPSonata
提出日時 2019-09-01 15:09:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 6,813 bytes
コンパイル時間 1,053 ms
コンパイル使用メモリ 113,472 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-18 18:50:21
合計ジャッジ時間 1,900 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma region
//gcc
//#include <bits/stdc++.h>
//clang
#include <set>      //******************************************************* *
#include <map>      //* *****          **                    *    **          *
#include <list>     //*       ******** ****** ******* ** ******** * ** * **** *
#include <queue>    //** ******      *            *   ** ***** ** *  * * ** * *
#include <stack>    //**     *** *** * ****** ** ****  * **         ** *  * * *
#include <cmath>    //** *** ******* *   *  * **** ***** ** **** ** ** **** * *
#include <ctime>    //** ***       * ***** ** * *  *     ** ******* **      * *
#include <cstdio>   //** ********* *        * ******* ****        * ******* * *
#include <vector>   //**      ** * * ****** * ** * *  * ** *** ** * ******* * *
#include <string>   //** ****  * * ******** * *  * ** *    *   ****         * *
#include <bitset>   //** **  * * *        *   **** ************************** *
#include <cctype>   //**   * * * ****** * ***            *                    *
#include <cstdlib>  //**** *   *        ** ****** ******** ********* **********
#include <cstring>  //**** ************ **    * * ******** *         *        *
#include <utility>  //*         * ************* *          ********* * ****** *
#include <numeric>  //* ******* * *       **    * ******** *****   * *      * *
#include <complex>  //* * *     * * ***** *  * ** *   ******   * * * ****** * *
#include <sstream>  //* * ***** * *   * * * ** ** * * ******** * **  ****** * *
#include <fstream>  //* *     * * * * * * * ** **** *          *    **      * *
#include <iomanip>  //* * *** *** * * *   * ** **** * ******** ************ * *
#include <cassert>  //*   * *     * * * *   **    * *     *******         * * *
#include <iostream> //* *** *** ***** * ********* * ***** **      ********* * *
#include <iterator> //* *             *         *   *****    ****           * 
#include <algorithm>//*********************************************************

using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;

const char alphabetl[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
const char alphabetu[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
const double pi     = 3.141592653589793238462643383279502884197169;
const double napier = 2.718281828459045235360287471352662497757247;
static const double EPS = 1e-14;
static const ll INFLL = 1e18;
static const int INF = (1 << 30) - 1;
static const ll MOD = (ll) 1e9 + 7;
const int NM = 10100;//max index of array

#define cauto const auto&
#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define itn int

#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define INF(a) memset(a, 0x3f, sizeof(a))

#define FILL(a,c) fill(a, a+ sizeof(a)/sizeof(*a),c)
#define FILL2D(A,c) fill(A[0], A[0] +sizeof(A)/sizeof(**A),c)
#define FILL3D(A,c) fill(A[0][0], A[0][0] +sizeof(A)/sizeof(***A),c)

#define SZ(x) ((int)(x).size())
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=0; i<=(int)(n); i++)
#define rrep(i,n) for(int i=(n-1); i>=0; i--)
#define rreps(i,n) for(int i=(n); i>=0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define FOREQ(i,a,b) for(int i=a; i<=(int)(b); i++)
#define RFOR(i,a,b) for(int i=a; i>(int)(b); i--)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)

#define ALL(x) (x).begin(),(x).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()

#define PRINT(n) cout << n << "\n";
#define PRINT2(n, m) cout << n << " " << m << " "<< "\n";

#define IN(a, x, b) (a<=x && x<b)
#define pb push_back

template<class T1, class T2> bool chmin(T1 &a, T2 b) { return b < a && (a = b, true); }
template<class T1, class T2> bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }


const ll MAX_V = 1010;
const ll MAX_E = 2010;
ll V, E;
struct edge {
    ll from, to, cost;
};
edge ES[MAX_E];
ll d[MAX_V];


class range {private: struct I{int x;int operator*(){return x;}bool operator!=(I& lhs){return x<lhs.x;}void operator++(){++x;}};I i,n;
public:range(int n):i({0}),n({n}){}range(int i,int n):i({i}),n({n}){}I& begin(){return i;}I& end(){return n;}};


int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


/** example
showElem(5, 2340182213LL) === false
showElem(8, 8327237484LL) === true
**/
bool showElem(int n, ll target) {
    if (9 < n) {
        return false;
    }
    string s = to_string(target);
    bool is = false;
    for(int i = 0; i < SZ(s); i++) {
        if (s[i] == char(n + '0')){
            is = true;
            break;
        }
    }
    return is;
}

void precalc() {
    /*
    for (int i = 2; i < C; ++i) {
        if (!least_prime[i]) {
            least_prime[i] = i;
            for (li j = i * 1LL * i; j < C; j += i) {
                least_prime[j] = i;
            }
        }
    }
    */
    /*
    fact[0] = revfact[0] = 1;
    for (int i = 1; i < 100500; ++i) {
        fact[i] = fact[i - 1] * i % curMod;
        revfact[i] = binpow(fact[i], curMod - 2, curMod);
    }
    */
    /*
    for (int w = 0; w < 2; ++w) {
        powers[w][0] = 1;
        for (int j = 1; j < C; ++j) {
            powers[w][j] = (powers[w][j - 1] * 1LL * pr[w]) % mods[w];
        }
    }
    */
    /*
    catalan[0] = 1;
    for (int n = 0; n < 200500 - 1; ++n) {
        catalan[n + 1] = catalan[n] * 2 * (2 * n + 1) % MOD * binpow(n + 2, MOD - 2, MOD) % MOD;
    }
    */
    /*
    for (int i = 0; i < 5010; ++i) {
        c[i][i] = c[i][0] = 1;
        for (int j = 1; j < i; ++j) {
            c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD;
        }
    }
    */
    /*
    for (int i = 0; i < 100; ++i) {
        doubleC[i][i] = doubleC[i][0] = 1.0;
        for (int j = 1; j < i; ++j) {
            doubleC[i][j] = doubleC[i - 1][j - 1] + doubleC[i - 1][j];
        }
    }
    */
}
void Main();
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(2);
    Main();
    return 0;
}

#pragma endregion

/***
 *  yukicoder No.431 死亡フラグ
 *  2019/09/01 GeckoCPPSonata
 ***/
void Main(){
    // Write your source code Here...
    int a = 0;
    int d;
    bool s;
    string ans;
    REP(i, 3) {
        cin >> d;
        a += d;
    }
    cin >> s;

    s ?
        ans = "SURVIVED"
        : a <= 1 ? ans = "SURVIVED" 
                :  ans = "DEAD";
    PRINT(ans)
}
0