結果

問題 No.2622 Dam
ユーザー hato336hato336
提出日時 2024-02-09 21:30:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 772 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 88,376 KB
最終ジャッジ日時 2024-02-09 21:30:13
合計ジャッジ時間 1,565 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
84,920 KB
testcase_01 AC 126 ms
88,376 KB
testcase_02 AC 125 ms
88,376 KB
testcase_03 AC 125 ms
88,376 KB
testcase_04 AC 125 ms
88,376 KB
testcase_05 AC 129 ms
88,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
input = sys.stdin.readline
#n = int(input())
#alist = list(map(int,input().split()))
#alist = []
#s = input()
for i in range(int(input())):
    v,x,fo,fi,q,r = map(int,input().split())
    now = x
    y = r * (fi-fo)
    now += y
    if now <= 0:
        print('Zero')
        continue
    if now > v:
        print('Overflow')
        continue
    y = (q-r) * (0-fo)
    now += y
    if now <= 0:
        print('Zero')
        continue
    if now > v:
        print('Overflow')
        continue
    if x-now > 0:
        print('Zero')
    elif x-now < 0:
        print('Overflow')
    else:
        print('Safe')
0