結果

問題 No.2684 折々の色
ユーザー SnowBeenDidingSnowBeenDiding
提出日時 2024-03-20 22:52:39
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,388 bytes
コンパイル時間 5,690 ms
コンパイル使用メモリ 320,752 KB
実行使用メモリ 44,148 KB
最終ジャッジ日時 2024-03-20 22:53:08
合計ジャッジ時間 24,837 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 AC 2 ms
6,548 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
6,548 KB
testcase_07 AC 2 ms
6,548 KB
testcase_08 WA -
testcase_09 AC 2 ms
6,548 KB
testcase_10 WA -
testcase_11 AC 285 ms
22,184 KB
testcase_12 AC 173 ms
15,488 KB
testcase_13 AC 296 ms
23,976 KB
testcase_14 AC 169 ms
14,592 KB
testcase_15 AC 171 ms
16,128 KB
testcase_16 AC 33 ms
6,548 KB
testcase_17 AC 154 ms
14,208 KB
testcase_18 AC 228 ms
20,976 KB
testcase_19 AC 351 ms
26,132 KB
testcase_20 AC 266 ms
19,840 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 641 ms
43,136 KB
testcase_30 AC 583 ms
40,580 KB
testcase_31 AC 596 ms
40,892 KB
testcase_32 AC 640 ms
43,452 KB
testcase_33 AC 654 ms
43,768 KB
testcase_34 AC 583 ms
40,396 KB
testcase_35 AC 594 ms
40,744 KB
testcase_36 AC 590 ms
40,580 KB
testcase_37 AC 600 ms
40,872 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 2 ms
6,548 KB
testcase_48 AC 2 ms
6,548 KB
testcase_49 AC 2 ms
6,548 KB
testcase_50 AC 2 ms
6,548 KB
testcase_51 AC 2 ms
6,548 KB
testcase_52 AC 2 ms
6,548 KB
testcase_53 AC 3 ms
6,548 KB
testcase_54 AC 2 ms
6,548 KB
testcase_55 AC 2 ms
6,548 KB
testcase_56 WA -
testcase_57 AC 2 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace std;
using namespace atcoder;

typedef long long ll;

ll make_hash(vector<ll> &v) {
    ll ret = 0;
    for (auto &x : v) {
        ret = ret * 1000000007 + x;
        ret %= 1000000007;
    }
    return ret;
}

int main() {
    int h, w;
    cin >> h >> w;
    vector<ll> x(w), t(h);
    rep(i, 0, w) cin >> x[i];
    vector<vector<ll>> c(h, vector<ll>(w));
    unordered_map<ll, int> ma;
    rep(i, 0, h) {
        rep(j, 0, w) cin >> c[i][j];
        cin >> t[i];
        c[i].push_back(t[i]);
        ma[make_hash(c[i])]++;
    }

    vector<ll> none = {-1};
    vector<ll> ret(w);
    auto f = [&](int ind, ll tt) {
        ret.clear();
        rep(j, 0, w) {
            ll q = 10000LL * x[j];
            q -= (100LL - tt) * t[ind] * c[ind][j];
            ll p = tt * 100;
            if (abs(q) % abs(p) != 0) return -1LL;
            ret[j] = q / p;
        }
        ret.push_back(tt);
        return make_hash(ret);
    };

    rep(i, 0, h) {
        ma[make_hash(c[i])]--;
        rep(j, 1, 101) {
            ll hash = f(i, j);
            if (hash == -1) continue;
            if (ma[hash]) {
                cout << "Yes" << endl;
                return 0;
            }
        }
        ma[make_hash(c[i])]++;
    }

    cout << "No" << endl;
}
0