結果
| 問題 | No.2622 Dam | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-02-09 21:44:16 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 739 bytes | 
| コンパイル時間 | 647 ms | 
| コンパイル使用メモリ | 76,824 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-09-28 14:58:27 | 
| 合計ジャッジ時間 | 1,049 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | WA * 5 | 
ソースコード
#include <iostream>
#include <cassert>
using namespace std;
using ll = long long;
void solve (ll V, ll X, int Fo, int Fi, int Q, int R) {
    // 制約を見落としていた。R < Qが常に成立。
    ll inflow = 1LL * R * Fi;
    ll outflow = 1LL * Q * Fo;
    if (inflow == outflow) {
        cout << "Safe\n";
        return;
    }
    
    if (inflow < outflow) {
        cout << "Zero\n";
        return;
    }
    if (outflow < inflow) {
        cout << "Overflow\n";
        return;
    }
    assert(0);
}
int main () {
    int T; cin >> T;
    while (T--) {
        ll V, X; cin >> V >> X;
        int Fo, Fi; cin >> Fo >> Fi;
        int Q, R; cin >> Q >> R;
        solve(V, X, Fo, Fi, Q, R);
    }
    return 0;
}
            
            
            
        