結果

問題 No.2622 Dam
ユーザー loop0919loop0919
提出日時 2024-01-01 23:43:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 67,980 KB
最終ジャッジ日時 2024-01-01 23:43:11
合計ジャッジ時間 1,263 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def solve():
    V, X, F_out, F_in, Q, R = map(int, input().split())
    F_sunny, F_rainy = - F_out, F_in - F_out
    
    
    if X + R * F_rainy > V:
        print("Overflow")
        return
    
    diff = R * F_rainy + (Q - R) * F_sunny
    if diff < 0:
        print("Zero")
    elif diff > 0:
        print("Overflow")
    else:
        print("Safe")

T = int(input())
for _ in range(T):
    solve()
0