結果

問題 No.2684 折々の色
ユーザー momoharamomohara
提出日時 2024-03-20 22:24:41
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,964 bytes
コンパイル時間 6,560 ms
コンパイル使用メモリ 328,328 KB
実行使用メモリ 51,756 KB
最終ジャッジ日時 2024-03-20 22:25:37
合計ジャッジ時間 17,931 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 AC 2 ms
6,548 KB
testcase_05 AC 2 ms
6,548 KB
testcase_06 AC 2 ms
6,548 KB
testcase_07 AC 2 ms
6,548 KB
testcase_08 AC 2 ms
6,548 KB
testcase_09 AC 2 ms
6,548 KB
testcase_10 AC 2 ms
6,548 KB
testcase_11 AC 175 ms
24,832 KB
testcase_12 AC 96 ms
17,664 KB
testcase_13 AC 162 ms
27,732 KB
testcase_14 AC 78 ms
16,000 KB
testcase_15 AC 107 ms
20,352 KB
testcase_16 AC 22 ms
7,296 KB
testcase_17 AC 98 ms
16,128 KB
testcase_18 AC 145 ms
25,112 KB
testcase_19 AC 177 ms
29,444 KB
testcase_20 AC 127 ms
22,912 KB
testcase_21 AC 36 ms
9,344 KB
testcase_22 AC 181 ms
25,744 KB
testcase_23 AC 128 ms
22,912 KB
testcase_24 AC 55 ms
11,392 KB
testcase_25 AC 86 ms
15,616 KB
testcase_26 AC 178 ms
29,312 KB
testcase_27 AC 108 ms
19,456 KB
testcase_28 AC 129 ms
22,784 KB
testcase_29 AC 321 ms
50,688 KB
testcase_30 AC 298 ms
45,040 KB
testcase_31 AC 288 ms
45,412 KB
testcase_32 AC 326 ms
51,024 KB
testcase_33 AC 318 ms
51,396 KB
testcase_34 AC 299 ms
44,908 KB
testcase_35 AC 300 ms
45,188 KB
testcase_36 AC 288 ms
45,044 KB
testcase_37 AC 299 ms
45,496 KB
testcase_38 AC 340 ms
51,756 KB
testcase_39 AC 338 ms
51,756 KB
testcase_40 AC 339 ms
51,756 KB
testcase_41 AC 344 ms
51,756 KB
testcase_42 AC 336 ms
51,756 KB
testcase_43 AC 337 ms
51,756 KB
testcase_44 AC 341 ms
51,756 KB
testcase_45 AC 339 ms
51,756 KB
testcase_46 AC 339 ms
51,756 KB
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 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 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <bits/stdc++.h>

using namespace std;
using namespace atcoder;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<ll, ll>;
using tp = tuple<ll, ll, ll>;

template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;

#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
#define rep(i, m, n) for(ll i = (ll)(m); i < (ll)(n); ++i)
#define rep2(i, m, n) for(ll i = (ll)(n)-1; i >= (ll)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)

constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
// constexpr long long MOD = (ll)1e9 + 7;
constexpr long long MOD = 998244353LL;
static const ld pi = 3.141592653589793L;

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

template <class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

struct Edge {
    int to, rev;
    ll cap;
    Edge(int _to, int _rev, ll _cap) : to(_to), rev(_rev), cap(_cap) {}
};

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph &G, int from, int to, ll cap, bool revFlag, ll revCap) {
    G[from].push_back(Edge(to, (int)G[to].size(), cap));
    if(revFlag)
        G[to].push_back(Edge(from, (int)G[from].size() - 1, revCap));
}

void solve() {
    ll n, m;
    cin >> n >> m;
    vec<ll> x(m);
    REP(i, m) { cin >> x[i]; }
    vvec<ll> c(n, vec<ll>(m, 0));
    vec<ll> t(n, 0);
    REP(i, n) {
        REP(j, m) {
            cin >> c[i][j];
        }
        cin >> t[i];
    }

    vvec<ll> x2s(n, vec<ll>(m, 0));
    REP(i, n) {
        REP(j, m) {
            x2s[i][j] = c[i][j] * t[i];
        }
    }
    sort(all(x2s));

    REP(i, n) {
        vec<ll> x1(m);
        REP(j, m) {
            x1[j] = c[i][j] * t[i];
        }
        if(t[i] == 100) {
            if(x1 == x) {
                cout << "Yes" << en;
                return;
            } else {
                continue;
            }
        }
        vec<ll> x2(m);
        bool flag = true;
        REP(j, m) {
            x2[j] = (x[j] * 100 - x1[j]) * 100;
            if(x2[j] % (100 - t[i])) {
                flag = false;
                break;
            }
            x2[j] /= 100 - t[i];
        }
        if(!flag)
            continue;
        if(x1 == x2)
            continue;
        if(upper_bound(all(x2s), x2) - lower_bound(all(x2s), x2)) {
            cout << "Yes" << en;
            return;
        }
    }
    cout << "No" << en;
    return;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // cout << fixed << setprecision(10);

    // ll t;
    // cin >> t;
    // REP(i, t - 1) {
    //     solve();
    // }

    solve();

    return 0;
}
0