結果

問題 No.2684 折々の色
ユーザー maeshunmaeshun
提出日時 2024-03-20 22:24:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,106 ms / 2,000 ms
コード長 1,813 bytes
コンパイル時間 5,304 ms
コンパイル使用メモリ 273,760 KB
実行使用メモリ 67,020 KB
最終ジャッジ日時 2024-03-20 22:24:57
合計ジャッジ時間 34,557 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 495 ms
33,280 KB
testcase_12 AC 309 ms
23,936 KB
testcase_13 AC 521 ms
37,272 KB
testcase_14 AC 252 ms
20,224 KB
testcase_15 AC 365 ms
28,032 KB
testcase_16 AC 62 ms
9,600 KB
testcase_17 AC 268 ms
21,760 KB
testcase_18 AC 478 ms
36,272 KB
testcase_19 AC 600 ms
38,272 KB
testcase_20 AC 385 ms
27,648 KB
testcase_21 AC 103 ms
12,928 KB
testcase_22 AC 561 ms
38,996 KB
testcase_23 AC 391 ms
29,952 KB
testcase_24 AC 166 ms
16,128 KB
testcase_25 AC 282 ms
21,504 KB
testcase_26 AC 544 ms
38,400 KB
testcase_27 AC 330 ms
25,984 KB
testcase_28 AC 398 ms
29,696 KB
testcase_29 AC 990 ms
63,920 KB
testcase_30 AC 967 ms
57,860 KB
testcase_31 AC 964 ms
56,932 KB
testcase_32 AC 1,070 ms
65,596 KB
testcase_33 AC 1,034 ms
63,768 KB
testcase_34 AC 939 ms
58,464 KB
testcase_35 AC 989 ms
58,876 KB
testcase_36 AC 969 ms
56,452 KB
testcase_37 AC 932 ms
57,684 KB
testcase_38 AC 1,066 ms
66,892 KB
testcase_39 AC 1,058 ms
67,020 KB
testcase_40 AC 1,044 ms
67,020 KB
testcase_41 AC 1,073 ms
67,020 KB
testcase_42 AC 1,066 ms
66,892 KB
testcase_43 AC 1,106 ms
66,892 KB
testcase_44 AC 1,082 ms
67,020 KB
testcase_45 AC 1,102 ms
66,892 KB
testcase_46 AC 1,070 ms
67,020 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 AC 2 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i, n) for(int i=0;i<(n);++i)
#define rep1(i, n) for(int i=1;i<=(n);i++)
#define ll long long
using mint = modint998244353;
using P = pair<ll,ll>;
using lb = long double;
using T = tuple<ll, ll, ll>;
#ifdef LOCAL
#  include <debug_print.hpp>
#  define dbg(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#  define dbg(...) (static_cast<void>(0))
#endif

int main()
{
    int n, m;
    cin >> n >> m;
    vector<ll> x(m);
    rep(i,m) cin >> x[i];
    map<vector<ll>, ll> st;
    vector<vector<ll>> c(n, vector<ll>(m));
    vector<ll> t(n);
    rep(i,n){
        rep(j,m) cin >> c[i][j];
        cin >> t[i];
        vector<ll> tmp;
        rep(j,m) {
            tmp.push_back(c[i][j]*t[i]);
        }
        st[tmp]++;
    }
    rep(i,n){
        if(t[i]==100) {
            bool ok = true;
            rep(j,m) {
                if(100*x[j]!=t[i]*c[i][j]) ok = false;
            } 
            if(ok) {
                cout<<"Yes"<<endl;
                return 0;
            }
            continue;
        }
        vector<ll> tmp;
        bool ok = true;
        rep(j,m) {
            ll v = 100*100*x[j]-100*t[i]*c[i][j];
            if(v%(100-t[i])) {
                ok = false;
                break;
            }
            tmp.push_back(v/(100-t[i]));
        }
        vector<ll> ts;
        rep(j,m) {
            ts.push_back(c[i][j]*t[i]);
        }
        dbg(ts,tmp);
        if(ok){
            if(tmp==ts && st[tmp]>=2){
                cout<<"Yes"<<endl;
                return 0;
            }
            else if(tmp!=ts && st[tmp]>=1){
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    }
    cout<<"No"<<endl;
    return 0;
}
0