結果

問題 No.2684 折々の色
ユーザー GOTKAKOGOTKAKO
提出日時 2024-03-20 22:55:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,141 bytes
コンパイル時間 2,353 ms
コンパイル使用メモリ 214,804 KB
実行使用メモリ 40,036 KB
最終ジャッジ日時 2024-03-20 22:55:36
合計ジャッジ時間 19,006 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 2 ms
6,676 KB
testcase_11 AC 232 ms
25,216 KB
testcase_12 AC 158 ms
18,048 KB
testcase_13 AC 276 ms
28,288 KB
testcase_14 AC 127 ms
16,384 KB
testcase_15 AC 221 ms
20,736 KB
testcase_16 AC 35 ms
8,576 KB
testcase_17 AC 132 ms
16,512 KB
testcase_18 AC 309 ms
31,656 KB
testcase_19 AC 280 ms
30,000 KB
testcase_20 AC 165 ms
18,176 KB
testcase_21 AC 61 ms
11,136 KB
testcase_22 AC 341 ms
32,460 KB
testcase_23 AC 191 ms
20,480 KB
testcase_24 AC 98 ms
13,824 KB
testcase_25 AC 143 ms
16,000 KB
testcase_26 AC 266 ms
25,856 KB
testcase_27 AC 195 ms
17,024 KB
testcase_28 AC 192 ms
20,224 KB
testcase_29 AC 473 ms
39,248 KB
testcase_30 AC 489 ms
39,568 KB
testcase_31 AC 452 ms
40,020 KB
testcase_32 AC 496 ms
39,412 KB
testcase_33 AC 504 ms
39,856 KB
testcase_34 AC 464 ms
39,560 KB
testcase_35 AC 491 ms
39,860 KB
testcase_36 AC 436 ms
39,568 KB
testcase_37 AC 458 ms
40,016 KB
testcase_38 AC 559 ms
40,036 KB
testcase_39 AC 500 ms
40,036 KB
testcase_40 AC 529 ms
40,036 KB
testcase_41 AC 503 ms
40,036 KB
testcase_42 AC 518 ms
40,036 KB
testcase_43 AC 519 ms
40,036 KB
testcase_44 AC 496 ms
40,036 KB
testcase_45 AC 509 ms
40,036 KB
testcase_46 AC 503 ms
40,036 KB
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 3 ms
6,676 KB
testcase_56 WA -
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;


    set<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);
        for(int k=0; k<M; k++){
            goal.at(k) -= 100*C.at(i).at(k);
            if(t == 100){if(goal.at(k) != 0){ok = false; break;}}
            else if(goal.at(k) >= 0){
                if(goal.at(k)%(100-t)){ok = false; break;}
                goal.at(k) /= 100-t;
            }
            else{ok = false; break;}
        } 
        if(t == 100){if(ok){yes = true; break;}}
        else if(S.count(goal) && ok){yes = true; break;}
    }
    if(yes) cout << "Yes" << endl;
    else cout << "No" << endl;

}
0