結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 3 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 396 ms
28,928 KB
testcase_12 AC 218 ms
20,992 KB
testcase_13 AC 319 ms
33,456 KB
testcase_14 AC 127 ms
18,560 KB
testcase_15 AC 287 ms
24,320 KB
testcase_16 AC 45 ms
8,576 KB
testcase_17 AC 207 ms
19,200 KB
testcase_18 AC 361 ms
31,688 KB
testcase_19 AC 352 ms
34,560 KB
testcase_20 AC 188 ms
25,728 KB
testcase_21 AC 100 ms
11,136 KB
testcase_22 AC 568 ms
32,492 KB
testcase_23 AC 271 ms
26,240 KB
testcase_24 AC 145 ms
13,824 KB
testcase_25 AC 211 ms
18,560 KB
testcase_26 AC 430 ms
33,536 KB
testcase_27 AC 278 ms
22,656 KB
testcase_28 AC 294 ms
25,984 KB
testcase_29 AC 615 ms
57,544 KB
testcase_30 AC 588 ms
51,996 KB
testcase_31 AC 488 ms
52,476 KB
testcase_32 AC 704 ms
57,812 KB
testcase_33 AC 561 ms
58,416 KB
testcase_34 AC 662 ms
51,832 KB
testcase_35 AC 629 ms
52,244 KB
testcase_36 AC 466 ms
51,996 KB
testcase_37 AC 556 ms
52,460 KB
testcase_38 AC 738 ms
58,852 KB
testcase_39 AC 780 ms
58,852 KB
testcase_40 AC 743 ms
58,852 KB
testcase_41 AC 760 ms
58,852 KB
testcase_42 AC 721 ms
58,852 KB
testcase_43 AC 724 ms
58,852 KB
testcase_44 AC 780 ms
58,852 KB
testcase_45 AC 744 ms
58,852 KB
testcase_46 AC 763 ms
58,852 KB
testcase_47 AC 2 ms
6,548 KB
testcase_48 WA -
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 WA -
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<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 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){
            if(X==C[i]){
                cout<<"Yes\n";
                return 0;
            }
            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