結果

問題 No.2684 折々の色
ユーザー GOTKAKOGOTKAKO
提出日時 2024-03-20 23:01:38
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,229 bytes
コンパイル時間 2,458 ms
コンパイル使用メモリ 214,848 KB
実行使用メモリ 40,020 KB
最終ジャッジ日時 2024-03-20 23:02:22
合計ジャッジ時間 28,991 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
6,676 KB
testcase_11 AC 383 ms
25,216 KB
testcase_12 AC 239 ms
18,048 KB
testcase_13 AC 382 ms
28,288 KB
testcase_14 AC 140 ms
16,384 KB
testcase_15 AC 305 ms
20,736 KB
testcase_16 AC 54 ms
8,576 KB
testcase_17 AC 199 ms
16,512 KB
testcase_18 AC 435 ms
31,656 KB
testcase_19 RE -
testcase_20 AC 201 ms
18,176 KB
testcase_21 RE -
testcase_22 AC 629 ms
32,460 KB
testcase_23 AC 313 ms
20,480 KB
testcase_24 RE -
testcase_25 AC 234 ms
16,000 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 674 ms
39,248 KB
testcase_30 RE -
testcase_31 AC 504 ms
40,020 KB
testcase_32 AC 754 ms
39,412 KB
testcase_33 AC 578 ms
39,856 KB
testcase_34 RE -
testcase_35 AC 664 ms
39,860 KB
testcase_36 AC 491 ms
39,568 KB
testcase_37 AC 580 ms
40,016 KB
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
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 3 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 #

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N,M; cin >> N >> M;
    vector<int> X(M),T(N);
    vector<vector<int>> C(N);
    for(auto &x : X) cin >> x,x *= 10000;


    multiset<vector<int>> S;
    for(int i=0; i<N; i++){
        vector<int> now(M);
        for(auto &n : now) cin >> n;
        int t; cin >> t;
        for(auto &n : now) n *= t;
        S.insert(now);
        C.at(i) = now; T.at(i) = t;
    }

    bool yes = false;
    for(int i=0; i<N; i++){
        vector<int> goal = X;
        bool ok = true;
        int t = T.at(i);
        if(t == 100){
            for(int k=0; k<M; k++) goal.at(k) /= 100;
            if(goal == C.at(i)){yes = true; break;}
        }
        t = 100-t;
        for(int k=0; k<M; k++){
            goal.at(k) -= 100*C.at(i).at(k);
            if(goal.at(k) >= 0){
                if(goal.at(k)%(t)){ok = false; break;}
                goal.at(k) /= t;
            }
            else{ok = false; break;}
        }
        S.erase(S.find(C.at(i)));
        if(S.count(goal) && ok){yes = true; break;}
        S.insert(C.at(i));
    }
    if(yes) cout << "Yes" << endl;
    else cout << "No" << endl;
}
0