結果

問題 No.2622 Dam
ユーザー ShirotsumeShirotsume
提出日時 2024-02-11 00:44:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 620 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 65,804 KB
最終ジャッジ日時 2024-02-11 00:44:17
合計ジャッジ時間 1,431 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
56,144 KB
testcase_01 AC 54 ms
65,804 KB
testcase_02 AC 54 ms
65,804 KB
testcase_03 AC 54 ms
65,784 KB
testcase_04 AC 55 ms
65,784 KB
testcase_05 AC 55 ms
65,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 61 - 1
mod = 998244353

def solve():
    v, x, vout, vin, q, r = mi()
    vin -= vout
    delta = vin * r - vout * (q - r)
    d1 = vin * r
    if x + d1 > v:
        print('Overflow')
    else:
        if delta > 0:
            print('Overflow')
        if delta < 0:
            print('Zero')
        if delta == 0:
            print('Safe')
    
    
    
    
for _ in range(ii()):
    solve()
0