結果

問題 No.846 メダル
ユーザー michonz4michonz4
提出日時 2020-01-04 13:50:23
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 484 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 28,132 KB
実行使用メモリ 8,756 KB
最終ジャッジ日時 2023-08-14 20:08:05
合計ジャッジ時間 4,585 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
8,756 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 0 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 0 ms
4,380 KB
testcase_07 AC 0 ms
4,376 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#define CEIL(a,b) ((a+b-1)/b)

int main() {
  long long P, Q, R, A, B, C, flg=0, min=1000000000000000000, max=0;
  scanf("%lld %lld %lld %lld %lld %lld", &P, &Q, &R, &A, &B, &C);

  for (long long i=(A+B+C)*R; i>(A+B+C)*R-R; i--) {
    if (CEIL(i, P)==A && CEIL(i, Q)==A+B && CEIL(i, R)==A+B+C) {
      if (i<min) min=i;
      if (i>max) max=i;
      flg=1;
    }
  }

  if (flg) {
    printf("%lld %lld", min, max);
  } else {
    printf("-1\n");
  }
  return 0;
}
0