結果

問題 No.2684 折々の色
ユーザー otoshigootoshigo
提出日時 2024-03-20 23:14:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,601 bytes
コンパイル時間 1,003 ms
コンパイル使用メモリ 90,976 KB
実行使用メモリ 58,852 KB
最終ジャッジ日時 2024-03-20 23:14:44
合計ジャッジ時間 22,564 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 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 2 ms
6,676 KB
testcase_10 AC 3 ms
6,676 KB
testcase_11 AC 378 ms
28,928 KB
testcase_12 AC 217 ms
20,992 KB
testcase_13 AC 318 ms
33,456 KB
testcase_14 AC 130 ms
18,560 KB
testcase_15 AC 286 ms
24,320 KB
testcase_16 AC 47 ms
8,576 KB
testcase_17 AC 184 ms
19,200 KB
testcase_18 AC 375 ms
31,688 KB
testcase_19 AC 381 ms
34,560 KB
testcase_20 AC 192 ms
25,728 KB
testcase_21 AC 101 ms
11,136 KB
testcase_22 AC 560 ms
32,492 KB
testcase_23 AC 287 ms
26,240 KB
testcase_24 AC 154 ms
13,824 KB
testcase_25 AC 218 ms
18,560 KB
testcase_26 AC 414 ms
33,536 KB
testcase_27 AC 280 ms
22,656 KB
testcase_28 AC 288 ms
25,984 KB
testcase_29 AC 660 ms
57,544 KB
testcase_30 AC 584 ms
51,996 KB
testcase_31 AC 474 ms
52,476 KB
testcase_32 AC 757 ms
57,812 KB
testcase_33 AC 573 ms
58,416 KB
testcase_34 AC 667 ms
51,832 KB
testcase_35 AC 662 ms
52,244 KB
testcase_36 AC 481 ms
51,996 KB
testcase_37 AC 546 ms
52,460 KB
testcase_38 AC 789 ms
58,852 KB
testcase_39 AC 784 ms
58,852 KB
testcase_40 AC 756 ms
58,852 KB
testcase_41 AC 768 ms
58,852 KB
testcase_42 AC 778 ms
58,852 KB
testcase_43 AC 824 ms
58,852 KB
testcase_44 AC 777 ms
58,852 KB
testcase_45 AC 788 ms
58,852 KB
testcase_46 AC 783 ms
58,852 KB
testcase_47 AC 2 ms
6,676 KB
testcase_48 WA -
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 WA -
testcase_54 AC 3 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 #

#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;
using ll=long long;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}
template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N,M;
    cin>>N>>M;
    vector<ll>X(M);
    for(int i=0;i<M;i++)cin>>X[i];
    vector C(N,vector<ll>(M));
    vector<int>T(N);
    for(int i=0;i<N;i++){
        for(int j=0;j<M;j++){
            cin>>C[i][j];
        }
        cin>>T[i];
    }
    for(int i=0;i<N;i++){
        if(T[i]==100){
            if(X==C[i]){
                cout<<"Yes\n";
                return 0;
            }
        }
    }
    for(int i=0;i<N;i++){
        for(int j=0;j<M;j++){
            C[i][j]*=T[i];
        }
    }
    multiset<vector<ll>>se;
    for(int i=0;i<N;i++)se.insert(C[i]);
    for(int i=0;i<N;i++){
        if(T[i]==100){
            se.erase(se.find(C[i]));
        }
    }
    for(int i=0;i<N;i++){
        if(T[i]==100)continue;
        vector<ll>W(M);
        bool ok=true;
        for(int j=0;j<M;j++){
            if((10000*X[j]-100*C[i][j])%(100-T[i])!=0){
                ok=false;
                break;
            }
            W[j]=(10000*X[j]-100*C[i][j])/(100-T[i]);
        }
        se.erase(se.find(C[i]));
        if(ok&&se.count(W)){
            cout<<"Yes\n";
            return 0;
        }
        se.insert(C[i]);
    }
    cout<<"No\n";
}
0