結果

問題 No.2684 折々の色
ユーザー RubikunRubikun
提出日時 2024-03-20 21:28:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 689 ms / 2,000 ms
コード長 1,877 bytes
コンパイル時間 2,528 ms
コンパイル使用メモリ 217,380 KB
実行使用メモリ 72,168 KB
最終ジャッジ日時 2024-03-20 21:28:54
合計ジャッジ時間 22,010 ms
ジャッジサーバーID
(参考情報)
judge12 / 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 291 ms
36,864 KB
testcase_12 AC 196 ms
27,392 KB
testcase_13 AC 347 ms
44,340 KB
testcase_14 AC 156 ms
23,168 KB
testcase_15 AC 223 ms
32,000 KB
testcase_16 AC 47 ms
10,752 KB
testcase_17 AC 169 ms
24,832 KB
testcase_18 AC 408 ms
43,980 KB
testcase_19 AC 358 ms
44,160 KB
testcase_20 AC 206 ms
30,976 KB
testcase_21 AC 78 ms
14,464 KB
testcase_22 AC 388 ms
45,164 KB
testcase_23 AC 255 ms
32,384 KB
testcase_24 AC 117 ms
18,304 KB
testcase_25 AC 169 ms
24,064 KB
testcase_26 AC 319 ms
41,728 KB
testcase_27 AC 206 ms
28,672 KB
testcase_28 AC 235 ms
32,128 KB
testcase_29 AC 641 ms
70,476 KB
testcase_30 AC 547 ms
65,052 KB
testcase_31 AC 548 ms
65,664 KB
testcase_32 AC 634 ms
70,872 KB
testcase_33 AC 593 ms
71,604 KB
testcase_34 AC 559 ms
64,892 KB
testcase_35 AC 558 ms
65,432 KB
testcase_36 AC 566 ms
65,052 KB
testcase_37 AC 559 ms
65,644 KB
testcase_38 AC 689 ms
72,168 KB
testcase_39 AC 617 ms
72,168 KB
testcase_40 AC 660 ms
72,168 KB
testcase_41 AC 626 ms
72,168 KB
testcase_42 AC 604 ms
72,168 KB
testcase_43 AC 638 ms
72,168 KB
testcase_44 AC 639 ms
72,168 KB
testcase_45 AC 626 ms
72,168 KB
testcase_46 AC 623 ms
72,168 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 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>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N,M;cin>>N>>M;
    vector<ll> tar(M);
    for(int i=0;i<M;i++){
        cin>>tar[i];
        tar[i]*=10000;
    }
    
    vector<vector<ll>> C(N,vector<ll>(M));
    vector<ll> T(N);
    map<vector<ll>,vector<ll>> MA;
    for(int i=0;i<N;i++){
        for(int j=0;j<M;j++){
            cin>>C[i][j];
        }
        cin>>T[i];
        
        vector<ll> S(M);
        for(int j=0;j<M;j++){
            S[j]=C[i][j]*T[i];
        }
        MA[S].push_back(i);
    }
    
    for(int i=0;i<N;i++){
        if(T[i]==100){
            bool f=true;
            for(int j=0;j<M;j++){
                f&=(tar[j]-100*T[i]*C[i][j]==0);
            }
            if(f){
                cout<<"Yes\n";
                return 0;
            }
            continue;
        }
        vector<ll> S(M);
        bool f=true;
        for(int j=0;j<M;j++){
            S[j]=tar[j]-100*T[i]*C[i][j];
            if(S[j]%(100-T[i])==0){
                S[j]/=(100-T[i]);
            }else{
                f=false;
            }
        }
        
        if(f){
            if(MA.count(S)){
                for(ll j:MA[S]){
                    if(i!=j){
                        cout<<"Yes\n";
                        return 0;
                    }
                }
            }
        }
    }
    
    cout<<"No\n";
}

0