結果

問題 No.2684 折々の色
ユーザー KKT89KKT89
提出日時 2024-03-20 21:17:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 796 ms / 2,000 ms
コード長 1,599 bytes
コンパイル時間 2,890 ms
コンパイル使用メモリ 226,748 KB
実行使用メモリ 59,592 KB
最終ジャッジ日時 2024-03-20 21:17:34
合計ジャッジ時間 29,550 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 3 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 3 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 359 ms
29,440 KB
testcase_12 AC 151 ms
21,376 KB
testcase_13 AC 506 ms
34,044 KB
testcase_14 AC 211 ms
18,816 KB
testcase_15 AC 279 ms
24,832 KB
testcase_16 AC 69 ms
8,704 KB
testcase_17 AC 183 ms
19,456 KB
testcase_18 AC 512 ms
32,380 KB
testcase_19 AC 490 ms
35,072 KB
testcase_20 AC 274 ms
25,984 KB
testcase_21 AC 121 ms
11,264 KB
testcase_22 AC 564 ms
33,272 KB
testcase_23 AC 337 ms
26,624 KB
testcase_24 AC 180 ms
14,080 KB
testcase_25 AC 246 ms
18,816 KB
testcase_26 AC 423 ms
34,048 KB
testcase_27 AC 283 ms
23,040 KB
testcase_28 AC 325 ms
26,368 KB
testcase_29 AC 520 ms
58,332 KB
testcase_30 AC 462 ms
52,748 KB
testcase_31 AC 523 ms
53,312 KB
testcase_32 AC 614 ms
58,616 KB
testcase_33 AC 526 ms
59,172 KB
testcase_34 AC 600 ms
52,612 KB
testcase_35 AC 631 ms
53,032 KB
testcase_36 AC 501 ms
52,748 KB
testcase_37 AC 664 ms
53,180 KB
testcase_38 AC 796 ms
59,592 KB
testcase_39 AC 792 ms
59,592 KB
testcase_40 AC 796 ms
59,592 KB
testcase_41 AC 777 ms
59,592 KB
testcase_42 AC 791 ms
59,592 KB
testcase_43 AC 766 ms
59,592 KB
testcase_44 AC 791 ms
59,592 KB
testcase_45 AC 773 ms
59,592 KB
testcase_46 AC 777 ms
59,592 KB
testcase_47 AC 2 ms
6,676 KB
testcase_48 AC 2 ms
6,676 KB
testcase_49 AC 2 ms
6,676 KB
testcase_50 AC 2 ms
6,676 KB
testcase_51 AC 2 ms
6,676 KB
testcase_52 AC 2 ms
6,676 KB
testcase_53 AC 2 ms
6,676 KB
testcase_54 AC 2 ms
6,676 KB
testcase_55 AC 2 ms
6,676 KB
testcase_56 AC 2 ms
6,676 KB
testcase_57 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline double time() {
    return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m; cin >> n >> m;
    vector<ll> x(m);
    for (int i = 0; i < m; ++i) {
        cin >> x[i];
        x[i] *= 10000;
    }
    set<vector<ll>> st[101];
    vector<vector<ll>> b(n);
    vector<ll> t(n);
    for (int i = 0; i < n; ++i) {
        vector<ll> a(m);
        for (int j = 0; j < m; ++j) {
            cin >> a[j];
        }
        b[i] = a;
        cin >> t[i];
        st[t[i]].insert(a);
    }

    vector<ll> target(m);
    for (int j = 0; j < n; ++j) {
        for (int ti = 1; ti <= 100; ++ti) {
            bool ok = true;
            for (int i = 0; i < m; ++i) {
                target[i] = x[i] - (100LL - ti) * t[j] * b[j][i];
                if (target[i]%(100*ti)) {
                    ok = false;
                    break;
                }
                else {
                    target[i] /= (100*ti);
                }
            }
            if (!ok) continue;
            if (st[ti].find(target) != st[ti].end() and target != b[j]) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}
0