結果

問題 No.2622 Dam
ユーザー 唐揚げが壊わ唐揚げが壊わ
提出日時 2024-02-09 22:00:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,660 bytes
コンパイル時間 1,561 ms
コンパイル使用メモリ 168,432 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-09 22:00:54
合計ジャッジ時間 2,087 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<long long>;
using vvll = vector<vector<long long>>;
using vvvll = vector<vector<vector<long long>>>;
using vvvvll = vector<vector<vector<vector<long long>>>>;
using vpll = vector<pair<ll, ll>>;
using vs = vector<string>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using pll = pair<ll, ll>;
#define REP(i, n) for (long long i = 0; i < n; i++)
#define REP2(i, n, m) for (long long i = n; i < m; i++)
#define REPv(v) for (auto itr = v.begin(); itr != v.end(); itr++)
#define REPIN(v) \
  for (long long i = 0; i < (long long)v.size(); i++) cin >> v[i];
#define been(vec) vec.begin(), vec.end()
#define LIN      \
  = []() {       \
    long long x; \
    cin >> x;    \
    return x;    \
  }()
#define SIN   \
  = []() {    \
    string x; \
    cin >> x; \
    return x; \
  }()
#define SPNL(i, SIZE) (i + 1 == SIZE ? '\n' : ' ')
ll gcd(ll x, ll y) { return (x % y) ? gcd(y, x % y) : y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
bool chmin(ll &a, const ll &b) { return (a > b && ((a = b) | 1)); }
bool chmax(ll &a, const ll &b) { return (a < b && ((a = b) | 1)); }

using namespace std;
int main() {
  ll t LIN;
  const string of = "Overflow", zr = "Zero", sf = "Safe";
  REP(_, t) {
    ll v, x, fo, fi, q, r;
    cin >> v >> x >> fo >> fi >> q >> r;
    ll c1, c2;
    c1 = (fi - fo) * r;
    c2 = fo * (q - r);
    if (c1 == c2) {
      if (v < c1 + x)
        cout << of << endl;
      else
        cout << sf << endl;
    } else if (c1 > c2) {
      cout << of << endl;
    } else {
      cout << zr << endl;
    }
  }
}
0