結果

問題 No.2622 Dam
ユーザー miya145592miya145592
提出日時 2024-02-09 23:19:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 63,756 KB
最終ジャッジ日時 2024-02-09 23:19:34
合計ジャッジ時間 977 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 49 ms
63,756 KB
testcase_02 AC 50 ms
63,756 KB
testcase_03 AC 50 ms
63,748 KB
testcase_04 AC 52 ms
63,748 KB
testcase_05 AC 51 ms
63,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
Overflow = "Overflow"
Zero = "Zero"
Safe = "Safe"
T = int(input())
VXFFQR = [list(map(int, input().split())) for _ in range(T)]
for v, x, f0, fi, q, r in VXFFQR:
    if v-x<(fi-f0)*r:
        print(Overflow)
        continue
    loop = (fi-f0)*r-f0*(q-r)
    if v-x+loop<=0:
        print(Zero)
        continue
    if loop==0:
        print(Safe)    
        continue
    elif loop>0:
        print(Overflow)
    else:
        print(Zero)
0