結果

問題 No.2622 Dam
ユーザー 👑 chro_96chro_96
提出日時 2024-02-09 21:32:40
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 661 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 28,544 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-09 21:32:41
合計ジャッジ時間 574 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0