結果

問題 No.2684 折々の色
ユーザー SnowBeenDidingSnowBeenDiding
提出日時 2024-03-20 22:54:52
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,362 bytes
コンパイル時間 6,955 ms
コンパイル使用メモリ 320,560 KB
実行使用メモリ 53,388 KB
最終ジャッジ日時 2024-03-20 22:55:28
合計ジャッジ時間 35,556 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 3 ms
6,548 KB
testcase_03 AC 2 ms
6,548 KB
testcase_04 AC 2 ms
6,548 KB
testcase_05 AC 2 ms
6,548 KB
testcase_06 AC 3 ms
6,548 KB
testcase_07 AC 2 ms
6,548 KB
testcase_08 AC 3 ms
6,548 KB
testcase_09 AC 3 ms
6,548 KB
testcase_10 AC 2 ms
6,548 KB
testcase_11 AC 624 ms
27,544 KB
testcase_12 AC 282 ms
19,860 KB
testcase_13 AC 778 ms
33,328 KB
testcase_14 AC 353 ms
17,700 KB
testcase_15 AC 415 ms
21,204 KB
testcase_16 AC 62 ms
7,552 KB
testcase_17 AC 291 ms
18,716 KB
testcase_18 AC 662 ms
30,232 KB
testcase_19 AC 746 ms
32,648 KB
testcase_20 AC 529 ms
24,404 KB
testcase_21 AC 159 ms
10,112 KB
testcase_22 AC 715 ms
31,076 KB
testcase_23 AC 539 ms
24,132 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 447 ms
20,624 KB
testcase_28 WA -
testcase_29 AC 890 ms
52,188 KB
testcase_30 AC 829 ms
49,484 KB
testcase_31 AC 942 ms
50,104 KB
testcase_32 AC 926 ms
52,460 KB
testcase_33 AC 901 ms
52,832 KB
testcase_34 AC 1,065 ms
49,824 KB
testcase_35 AC 1,086 ms
50,260 KB
testcase_36 AC 911 ms
49,616 KB
testcase_37 AC 967 ms
50,224 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 3 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 2 ms
6,548 KB
testcase_54 AC 2 ms
6,548 KB
testcase_55 AC 2 ms
6,548 KB
testcase_56 AC 2 ms
6,548 KB
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 %= 998244353;
    }
    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> ret;
    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.push_back(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