結果
| 問題 |
No.2622 Dam
|
| コンテスト | |
| ユーザー |
chro_96
|
| 提出日時 | 2024-02-09 21:32:40 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 661 bytes |
| コンパイル時間 | 1,166 ms |
| コンパイル使用メモリ | 28,288 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-09-28 14:43:38 |
| 合計ジャッジ時間 | 1,677 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
#include <stdio.h>
int main () {
int t = 0;
long long v = 0LL;
long long x = 0LL;
long long f0 = 0LL;
long long fi = 0LL;
long long q = 0LL;
long long r = 0LL;
int res = 0;
res = scanf("%d", &t);
while (t > 0) {
long long tmp = 0LL;
res = scanf("%lld", &v);
res = scanf("%lld", &x);
res = scanf("%lld", &f0);
res = scanf("%lld", &fi);
res = scanf("%lld", &q);
res = scanf("%lld", &r);
tmp = x+(fi-f0)*r;
if (tmp > v || tmp-f0*(q-r) > x) {
printf("Overflow\n");
} else if (tmp-f0*(q-r) < x) {
printf("Zero\n");
} else {
printf("Safe\n");
}
t--;
}
return 0;
}
chro_96