結果
| 問題 | No.2622 Dam |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-09 21:30:12 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 88 ms / 2,000 ms |
| コード長 | 772 bytes |
| 記録 | |
| コンパイル時間 | 326 ms |
| コンパイル使用メモリ | 85,336 KB |
| 実行使用メモリ | 86,304 KB |
| 最終ジャッジ日時 | 2026-04-15 04:46:31 |
| 合計ジャッジ時間 | 1,605 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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')