結果
問題 | No.2622 Dam |
ユーザー |
![]() |
提出日時 | 2024-03-24 11:06:36 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 856 bytes |
コンパイル時間 | 1,407 ms |
コンパイル使用メモリ | 120,912 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-09-30 13:47:01 |
合計ジャッジ時間 | 1,964 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 |
ソースコード
#define _USE_MATH_DEFINES#include <iostream>#include <string>#include <algorithm>#include <vector>#include <queue>#include <math.h>#include <cmath>#include <stack>#include <map>#include <set>#include <numeric>#include <iomanip>#include <climits>#include <functional>#include <cassert>#include <tuple>using namespace std;using ll = long long;int T;int main() {cin >> T;vector<string> ans;while(T--) {ll V, X, Fo, Fi, Q, R;cin >> V >> X >> Fo >> Fi >> Q >> R;if((Fi-Fo)*R+X > V) ans.push_back("Overflow");else if(Fi*R-Fo*Q+X <= 0) ans.push_back("Zero");else {if(Fi*R-Fo*Q > 0) ans.push_back("Overflow");else if(Fi*R-Fo*Q < 0) ans.push_back("Zero");else ans.push_back("Safe");}}for(auto s : ans) cout << s << endl;}