結果
問題 | No.2622 Dam |
ユーザー |
![]() |
提出日時 | 2024-02-16 22:17:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 660 bytes |
コンパイル時間 | 402 ms |
コンパイル使用メモリ | 40,704 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-09-28 20:53:32 |
合計ジャッジ時間 | 852 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 3 |
ソースコード
/* -*- coding: utf-8 -*-** 2622.cc: No.2622 Dam - yukicoder*/#include<cstdio>#include<algorithm>using namespace std;/* constant *//* typedef */typedef long long ll;/* global variables *//* subroutines *//* main */int main() {int tn;scanf("%d", &tn);while (tn--) {ll v, x;int fo, fi, q, r;scanf("%lld%lld%d%d%d%d", &v, &x, &fo, &fi, &q, &r);ll s = x;s += (ll)(fi - fo) * r;if (s > v) { puts("Overflow"); continue; }s -= fo * (q - r);if (s <= 0) { puts("Zero"); continue; }if (s > x) puts("Overflow");else if (s < x) puts("Zero");else puts("Safe");}return 0;}