結果

問題 No.2860 Heal Slimes
ユーザー テナガザルテナガザル
提出日時 2024-08-25 16:06:41
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 619 bytes
コンパイル時間 981 ms
コンパイル使用メモリ 95,852 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-08-25 16:07:04
合計ジャッジ時間 7,809 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 75 ms
6,940 KB
testcase_11 AC 74 ms
6,940 KB
testcase_12 AC 74 ms
6,944 KB
testcase_13 AC 76 ms
6,940 KB
testcase_14 AC 74 ms
6,940 KB
testcase_15 AC 78 ms
6,940 KB
testcase_16 AC 78 ms
6,944 KB
testcase_17 AC 83 ms
6,940 KB
testcase_18 AC 75 ms
6,940 KB
testcase_19 AC 75 ms
6,940 KB
testcase_20 AC 56 ms
6,940 KB
testcase_21 AC 59 ms
6,940 KB
testcase_22 AC 37 ms
6,940 KB
testcase_23 AC 77 ms
6,944 KB
testcase_24 AC 69 ms
6,940 KB
testcase_25 AC 39 ms
6,940 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 48 ms
6,944 KB
testcase_30 WA -
testcase_31 AC 87 ms
6,944 KB
testcase_32 WA -
testcase_33 AC 59 ms
6,944 KB
testcase_34 AC 82 ms
6,940 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 57 ms
6,944 KB
testcase_39 AC 62 ms
6,944 KB
testcase_40 AC 77 ms
6,944 KB
testcase_41 AC 77 ms
6,940 KB
testcase_42 AC 74 ms
6,940 KB
testcase_43 AC 76 ms
6,944 KB
testcase_44 AC 78 ms
6,944 KB
testcase_45 AC 77 ms
6,944 KB
testcase_46 AC 77 ms
6,940 KB
testcase_47 AC 78 ms
6,944 KB
testcase_48 AC 85 ms
6,944 KB
testcase_49 AC 79 ms
6,940 KB
testcase_50 AC 77 ms
6,940 KB
testcase_51 AC 78 ms
6,940 KB
testcase_52 AC 76 ms
6,944 KB
testcase_53 AC 78 ms
6,940 KB
testcase_54 AC 85 ms
6,940 KB
testcase_55 AC 80 ms
6,940 KB
testcase_56 AC 77 ms
6,944 KB
testcase_57 AC 78 ms
6,940 KB
testcase_58 AC 79 ms
6,940 KB
testcase_59 AC 78 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

void solve()
{
  int n, k, x;
  cin >> n >> k >> x;
  vector<int> h(n), cnt(n);
  for (int i = 0; i < n; ++i) cin >> h[i];
  int mi = 1e9;
  for (int i = 0; i < n; ++i) mi = min(mi, h[i]);
  for (int i = 0; i < n - 1; ++i)
  {
    int d = abs(h[i] - h[i + 1]);
    if (d % x)
    {
      cout << "No" << endl;
      return;
    }
  }
  long long sum = 0;
  for (int i = 0; i < n; ++i) sum += (h[i] - mi) / x;
  int g = __gcd(n, k);
  cout << (sum % g ? "No" : "Yes") << endl;
}

int main()
{
  int t;
  cin >> t;
  while (t--) solve();
}
0