結果

問題 No.2622 Dam
ユーザー AngrySadEightAngrySadEight
提出日時 2024-01-16 13:16:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 67,852 KB
最終ジャッジ日時 2024-01-16 13:16:34
合計ジャッジ時間 1,328 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,332 KB
testcase_01 AC 63 ms
65,756 KB
testcase_02 AC 65 ms
65,756 KB
testcase_03 AC 64 ms
67,852 KB
testcase_04 AC 64 ms
67,852 KB
testcase_05 AC 67 ms
67,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
assert 1 <= T <= 1000
for _ in range(T):
    V, X, Fo, Fi, Q, R = map(int, input().split())
    assert 1 <= X <= V <= 10 ** 18
    assert 1 <= Fo <= 10 ** 9
    assert 1 <= Fi <= 10 ** 9
    assert 1 <= R < Q <= 10 ** 9

    if X + R * (Fi - Fo) > V:
        print("Overflow")
    else:
        if R * Fi - Q * Fo > 0:
            print("Overflow")
        elif R * Fi - Q * Fo < 0:
            print("Zero")
        else:
            print("Safe")
0