結果

問題 No.2684 折々の色
ユーザー てんぷらてんぷら
提出日時 2024-03-20 21:41:21
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 526 ms / 2,000 ms
コード長 1,760 bytes
コンパイル時間 7,618 ms
コンパイル使用メモリ 318,252 KB
実行使用メモリ 46,228 KB
最終ジャッジ日時 2024-03-20 21:41:46
合計ジャッジ時間 21,505 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 3 ms
6,548 KB
testcase_02 AC 3 ms
6,548 KB
testcase_03 AC 3 ms
6,548 KB
testcase_04 AC 3 ms
6,548 KB
testcase_05 AC 2 ms
6,548 KB
testcase_06 AC 2 ms
6,548 KB
testcase_07 AC 3 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 240 ms
28,672 KB
testcase_12 AC 157 ms
20,352 KB
testcase_13 AC 322 ms
31,392 KB
testcase_14 AC 118 ms
17,536 KB
testcase_15 AC 184 ms
23,808 KB
testcase_16 AC 35 ms
9,344 KB
testcase_17 AC 136 ms
18,432 KB
testcase_18 AC 301 ms
35,400 KB
testcase_19 AC 322 ms
33,024 KB
testcase_20 AC 168 ms
19,584 KB
testcase_21 AC 61 ms
12,672 KB
testcase_22 AC 321 ms
38,124 KB
testcase_23 AC 186 ms
23,296 KB
testcase_24 AC 93 ms
15,744 KB
testcase_25 AC 132 ms
18,304 KB
testcase_26 AC 262 ms
29,696 KB
testcase_27 AC 158 ms
19,584 KB
testcase_28 AC 195 ms
23,040 KB
testcase_29 AC 465 ms
43,984 KB
testcase_30 AC 448 ms
44,256 KB
testcase_31 AC 415 ms
43,516 KB
testcase_32 AC 471 ms
45,220 KB
testcase_33 AC 489 ms
43,944 KB
testcase_34 AC 452 ms
44,744 KB
testcase_35 AC 484 ms
44,980 KB
testcase_36 AC 434 ms
43,104 KB
testcase_37 AC 445 ms
44,144 KB
testcase_38 AC 526 ms
46,228 KB
testcase_39 AC 494 ms
46,228 KB
testcase_40 AC 524 ms
46,228 KB
testcase_41 AC 494 ms
46,228 KB
testcase_42 AC 490 ms
46,228 KB
testcase_43 AC 521 ms
46,228 KB
testcase_44 AC 497 ms
46,228 KB
testcase_45 AC 515 ms
46,228 KB
testcase_46 AC 482 ms
46,228 KB
testcase_47 AC 3 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 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 <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
using namespace std;
using namespace atcoder;
using mint = modint998244353;
const int inf = 1000000007;
const ll longinf = 1ll << 60;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m;
    cin >> n >> m;
    vector<int> y(m);
    rep(i, m) {
        cin >> y[i];
        y[i] *= 10000;
    }
    vector x(n, vector(m, 0));
    vector<int> t(n);
    map<vector<int>, int> mp;
    rep(i, n) {
        rep(j, m) cin >> x[i][j];
        cin >> t[i];
        rep(j, m) {
            x[i][j] *= t[i];
        }
        mp[x[i]] += 1;
    }
    rep(i, n) {
        vector<int> target = y;
        rep(j, m) {
            target[j] -= 100 * x[i][j];
        }
        if(t[i] == 100) {
            bool ok = true;
            rep(j, m) {
                if(target[j] != 0)
                    ok = false;
            }
            if(ok) {
                cout << "Yes" << endl;
                return 0;
            }
        } else {
            bool ok = true;
            rep(j, m) {
                if(target[j] % (100 - t[i])) {
                    ok = false;
                    break;
                } else {
                    target[j] /= 100 - t[i];
                }
            }
            if(ok) {
                int cnt = mp[target];
                if(target == x[i])
                    --cnt;
                if(cnt > 0) {
                    cout << "Yes" << endl;
                    return 0;
                }
            }
        }
    }
    cout << "No" << endl;
    return 0;
}
0