AcWing 4791. 死或生
原题链接
简单
作者:
Coinisi.
,
2023-01-07 20:17:47
,
所有人可见
,
阅读 197
// 我写了好长时间,笨死了
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#define IOS std::ios::sync_with_stdio(false)
#define inf 0x3f3f3f3f
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define int long long
// #define x first
// #define y second
//#define cmp [&](PII a, PII b){ return a.y < b.y; }
const int N = 5e5+10, mod = 1e9+7, M = 1e6+5, K = 1e5+10, Z = 2e5+7;
using namespace std;
typedef long long LL;
typedef priority_queue<int> PQI;
typedef priority_queue <int, vector<int>, greater<>> PQGI;
typedef pair<int, int> PII;
void solve()
{
int n; cin >> n;
int sum1_l = 0, sum2_l = 0, sum1_d = 0, sum2_d = 0;
while( n -- )
{
int t, x, y; cin >> t >> x >> y;
if(t == 1)
sum1_l = sum1_l + x, sum1_d = sum1_d + y;
else if(t == 2)
sum2_l = sum2_l + x, sum2_d = sum2_d + y;
}
if(sum1_l >= sum1_d) cout << "LIVE" << endl;
else cout << "DEAD" << endl;
if(sum2_l >= sum2_d) cout << "LIVE" << endl;
else cout << "DEAD" << endl;
return;
}
signed main()
{
IOS; int T = 1;
// cin >> T;
while( T -- ) solve();
return 0;
}