結果
| 問題 |
No.2622 Dam
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-09 21:30:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 146 ms / 2,000 ms |
| コード長 | 772 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 82,044 KB |
| 実行使用メモリ | 89,428 KB |
| 最終ジャッジ日時 | 2024-09-28 13:55:45 |
| 合計ジャッジ時間 | 1,612 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
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')