結果
| 問題 |
No.2622 Dam
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-01-11 00:40:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 2,000 ms |
| コード長 | 801 bytes |
| コンパイル時間 | 1,962 ms |
| コンパイル使用メモリ | 195,040 KB |
| 最終ジャッジ日時 | 2025-02-18 17:05:17 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
const ll mod = 998244353;
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define faster ios::sync_with_stdio(false);cin.tie(nullptr)
int main() {
ll T;
cin >> T;
while(T--){
ll V,X,Fo,Fi,Q,R;
cin >> V >> X >> Fo >> Fi >> Q >> R;
ll cnt1=Fi*R-Fo*R;
ll cnt2=Fi*R-Fo*Q;
if(cnt2>0){
cout << "Overflow" << endl;
}else if(X+cnt1>V){
cout << "Overflow" << endl;
}else if(cnt2<0){
cout << "Zero" << endl;
}else{
cout << "Safe" << endl;
}
}
return 0;
}