結果

問題 No.2684 折々の色
ユーザー GOTKAKOGOTKAKO
提出日時 2024-03-20 23:02:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 861 ms / 2,000 ms
コード長 1,251 bytes
コンパイル時間 2,705 ms
コンパイル使用メモリ 214,708 KB
実行使用メモリ 40,036 KB
最終ジャッジ日時 2024-03-20 23:02:36
合計ジャッジ時間 26,188 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 3 ms
6,548 KB
testcase_09 AC 2 ms
6,548 KB
testcase_10 AC 2 ms
6,548 KB
testcase_11 AC 401 ms
25,216 KB
testcase_12 AC 248 ms
18,048 KB
testcase_13 AC 394 ms
28,288 KB
testcase_14 AC 151 ms
16,384 KB
testcase_15 AC 331 ms
20,736 KB
testcase_16 AC 57 ms
8,576 KB
testcase_17 AC 207 ms
16,512 KB
testcase_18 AC 419 ms
31,656 KB
testcase_19 AC 414 ms
30,000 KB
testcase_20 AC 206 ms
18,176 KB
testcase_21 AC 119 ms
11,136 KB
testcase_22 AC 672 ms
32,460 KB
testcase_23 AC 318 ms
20,480 KB
testcase_24 AC 184 ms
13,824 KB
testcase_25 AC 249 ms
16,000 KB
testcase_26 AC 452 ms
25,856 KB
testcase_27 AC 279 ms
17,024 KB
testcase_28 AC 289 ms
20,224 KB
testcase_29 AC 682 ms
39,248 KB
testcase_30 AC 642 ms
39,568 KB
testcase_31 AC 553 ms
40,020 KB
testcase_32 AC 758 ms
39,412 KB
testcase_33 AC 644 ms
39,856 KB
testcase_34 AC 686 ms
39,560 KB
testcase_35 AC 732 ms
39,860 KB
testcase_36 AC 539 ms
39,568 KB
testcase_37 AC 603 ms
40,016 KB
testcase_38 AC 831 ms
40,036 KB
testcase_39 AC 815 ms
40,036 KB
testcase_40 AC 858 ms
40,036 KB
testcase_41 AC 840 ms
40,036 KB
testcase_42 AC 792 ms
40,036 KB
testcase_43 AC 861 ms
40,036 KB
testcase_44 AC 848 ms
40,036 KB
testcase_45 AC 833 ms
40,036 KB
testcase_46 AC 825 ms
40,036 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 2 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;

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;}
            continue;
        }
        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