結果

問題 No.2684 折々の色
ユーザー SnowBeenDidingSnowBeenDiding
提出日時 2024-03-20 22:48:56
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,323 bytes
コンパイル時間 5,550 ms
コンパイル使用メモリ 319,708 KB
実行使用メモリ 54,028 KB
最終ジャッジ日時 2024-03-20 22:49:59
合計ジャッジ時間 53,434 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 4 ms
6,548 KB
testcase_03 AC 2 ms
6,548 KB
testcase_04 AC 4 ms
6,548 KB
testcase_05 AC 3 ms
6,548 KB
testcase_06 AC 3 ms
6,548 KB
testcase_07 AC 2 ms
6,548 KB
testcase_08 AC 4 ms
6,548 KB
testcase_09 AC 2 ms
6,548 KB
testcase_10 AC 3 ms
6,548 KB
testcase_11 AC 971 ms
27,544 KB
testcase_12 AC 261 ms
19,860 KB
testcase_13 AC 1,375 ms
33,328 KB
testcase_14 AC 571 ms
17,700 KB
testcase_15 AC 629 ms
21,204 KB
testcase_16 AC 109 ms
7,552 KB
testcase_17 AC 403 ms
18,716 KB
testcase_18 AC 1,236 ms
30,232 KB
testcase_19 AC 1,226 ms
32,648 KB
testcase_20 AC 756 ms
24,404 KB
testcase_21 AC 352 ms
10,112 KB
testcase_22 AC 1,452 ms
31,076 KB
testcase_23 AC 878 ms
24,132 KB
testcase_24 AC 502 ms
13,020 KB
testcase_25 AC 689 ms
18,316 KB
testcase_26 AC 1,167 ms
30,296 KB
testcase_27 AC 801 ms
20,624 KB
testcase_28 AC 885 ms
23,944 KB
testcase_29 AC 990 ms
52,184 KB
testcase_30 AC 881 ms
49,484 KB
testcase_31 AC 1,133 ms
50,104 KB
testcase_32 AC 1,372 ms
52,716 KB
testcase_33 AC 1,022 ms
52,832 KB
testcase_34 AC 1,443 ms
49,824 KB
testcase_35 AC 1,497 ms
50,260 KB
testcase_36 AC 1,050 ms
49,616 KB
testcase_37 AC 1,598 ms
50,476 KB
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
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 3 ms
6,548 KB
testcase_51 AC 3 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;
    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};
    auto f = [&](int ind, ll tt) {
        vector<ll> ret(w);
        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 none;
            ret[j] = q / p;
        }
        ret.push_back(tt);
        return ret;
    };

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

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