結果

問題 No.2684 折々の色
ユーザー KudeKude
提出日時 2024-03-20 23:27:41
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 616 ms / 2,000 ms
コード長 1,703 bytes
コンパイル時間 3,375 ms
コンパイル使用メモリ 281,044 KB
実行使用メモリ 27,644 KB
最終ジャッジ日時 2024-03-20 23:28:10
合計ジャッジ時間 22,459 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 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
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 265 ms
17,828 KB
testcase_12 AC 180 ms
15,016 KB
testcase_13 AC 367 ms
23,160 KB
testcase_14 AC 136 ms
11,904 KB
testcase_15 AC 229 ms
17,260 KB
testcase_16 AC 41 ms
7,424 KB
testcase_17 AC 164 ms
13,824 KB
testcase_18 AC 410 ms
25,808 KB
testcase_19 AC 327 ms
20,896 KB
testcase_20 AC 185 ms
13,056 KB
testcase_21 AC 68 ms
9,472 KB
testcase_22 AC 425 ms
26,528 KB
testcase_23 AC 197 ms
14,628 KB
testcase_24 AC 109 ms
11,648 KB
testcase_25 AC 150 ms
13,312 KB
testcase_26 AC 283 ms
18,224 KB
testcase_27 AC 203 ms
14,252 KB
testcase_28 AC 199 ms
14,464 KB
testcase_29 AC 560 ms
27,080 KB
testcase_30 AC 594 ms
27,284 KB
testcase_31 AC 539 ms
27,496 KB
testcase_32 AC 588 ms
27,124 KB
testcase_33 AC 563 ms
27,452 KB
testcase_34 AC 580 ms
27,268 KB
testcase_35 AC 568 ms
27,456 KB
testcase_36 AC 574 ms
27,288 KB
testcase_37 AC 582 ms
27,492 KB
testcase_38 AC 585 ms
27,644 KB
testcase_39 AC 602 ms
27,644 KB
testcase_40 AC 578 ms
27,644 KB
testcase_41 AC 616 ms
27,644 KB
testcase_42 AC 575 ms
27,644 KB
testcase_43 AC 607 ms
27,644 KB
testcase_44 AC 566 ms
27,644 KB
testcase_45 AC 604 ms
27,644 KB
testcase_46 AC 568 ms
27,644 KB
testcase_47 AC 2 ms
6,676 KB
testcase_48 AC 2 ms
6,676 KB
testcase_49 AC 3 ms
6,676 KB
testcase_50 AC 2 ms
6,676 KB
testcase_51 AC 2 ms
6,676 KB
testcase_52 AC 2 ms
6,676 KB
testcase_53 AC 2 ms
6,676 KB
testcase_54 AC 2 ms
6,676 KB
testcase_55 AC 2 ms
6,676 KB
testcase_56 AC 2 ms
6,676 KB
testcase_57 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
namespace {
#pragma GCC diagnostic ignored "-Wunused-function"
#include<atcoder/all>
#pragma GCC diagnostic warning "-Wunused-function"
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(i,n) for(int i = (int)(n) - 1; i >= 0; i--)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
template<class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return true; } else return false; }
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;

} int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  using A = array<int, 10>;
  int n, m;
  cin >> n >> m;
  A x{};
  rep(i, m) cin >> x[i];
  vector<A> c(n);
  VI t(n);
  bool ans = false;
  rep(i, n) {
    rep(j, m) cin >> c[i][j];
    cin >> t[i];
  }
  rep(i, n) if (t[i] == 100) {
    if (c[i] == x) ans = true;
  }
  if (ans) {
    cout << "Yes\n";
    return 0;
  }
  rep(j, m) x[j] *= 10000;
  rep(_, 2) {
    set<A> st;
    rep(i, n) {
      if (t[i] < 100) {
        bool ok = true;
        A tgt{};
        rep(j, m) {
          tgt[j] = x[j] - 100 * t[i] * c[i][j];
          if (tgt[j] % (100 - t[i])) {
            ok = false;
            break;
          }
          tgt[j] /= 100 - t[i];
        }
        if (ok && st.contains(tgt)) {
          ans = true;
        }
      }
      A ins{};
      rep(j, m) ins[j] = c[i][j] * t[i];
      st.insert(ins);
    }
    reverse(all(c));
    reverse(all(t));
  }
  cout << (ans ? "Yes\n" : "No\n");
}
0