結果

問題 No.2684 折々の色
ユーザー zawakasuzawakasu
提出日時 2024-03-20 21:58:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,782 bytes
コンパイル時間 2,479 ms
コンパイル使用メモリ 217,156 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2024-03-20 21:58:45
合計ジャッジ時間 22,687 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
6,548 KB
testcase_09 AC 2 ms
6,548 KB
testcase_10 AC 2 ms
6,548 KB
testcase_11 AC 306 ms
28,544 KB
testcase_12 AC 221 ms
22,016 KB
testcase_13 AC 403 ms
35,072 KB
testcase_14 AC 181 ms
18,304 KB
testcase_15 AC 262 ms
25,600 KB
testcase_16 AC 52 ms
9,472 KB
testcase_17 AC 198 ms
20,096 KB
testcase_18 AC 436 ms
36,096 KB
testcase_19 AC 409 ms
34,048 KB
testcase_20 AC 231 ms
23,168 KB
testcase_21 AC 80 ms
12,544 KB
testcase_22 AC 463 ms
37,120 KB
testcase_23 AC 249 ms
24,704 KB
testcase_24 AC 140 ms
15,488 KB
testcase_25 AC 186 ms
19,456 KB
testcase_26 AC 342 ms
31,488 KB
testcase_27 AC 215 ms
22,400 KB
testcase_28 AC 250 ms
24,448 KB
testcase_29 AC 652 ms
51,328 KB
testcase_30 AC 598 ms
48,384 KB
testcase_31 AC 645 ms
48,896 KB
testcase_32 AC 618 ms
51,712 KB
testcase_33 AC 662 ms
52,096 KB
testcase_34 AC 605 ms
48,256 KB
testcase_35 AC 643 ms
48,640 KB
testcase_36 AC 591 ms
48,384 KB
testcase_37 AC 639 ms
48,768 KB
testcase_38 AC 635 ms
52,480 KB
testcase_39 AC 670 ms
52,480 KB
testcase_40 AC 643 ms
52,480 KB
testcase_41 AC 671 ms
52,608 KB
testcase_42 AC 638 ms
52,480 KB
testcase_43 AC 671 ms
52,480 KB
testcase_44 AC 641 ms
52,480 KB
testcase_45 AC 696 ms
52,480 KB
testcase_46 AC 638 ms
52,608 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 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>




namespace zawa {

using i16 = std::int16_t;
using i32 = std::int32_t;
using i64 = std::int64_t;
using i128 = __int128_t;

using u8 = std::uint8_t;
using u16 = std::uint16_t;
using u32 = std::uint32_t;
using u64 = std::uint64_t;

using usize = std::size_t;

} // namespace zawa


namespace zawa {

void SetFastIO() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
}

void SetPrecision(u32 dig) {
    std::cout << std::fixed << std::setprecision(dig);
}

} // namespace zawa
using namespace zawa;

int main() {
    SetFastIO();

    int n, m; std::cin >> n >> m;
    std::vector<long long> x(m);
    for (auto& v : x) std::cin >> v;

    std::map<std::vector<long long>, std::vector<int>> map;
    for (int i{} ; i < n ; i++) {
        bool can{true};
        std::vector<long long> c(m);
        for (auto& v : c) std::cin >> v;
        long long t; std::cin >> t;
        std::vector<long long> left(m), right(m);
        for (int k{} ; k < m ; k++) {
            if (t < 100) {
                can &= ((10000 * x[k] - 100 * t * c[k]) % (100 - t)) == 0;
                left[k] = (10000 * x[k] - 100 * t * c[k]) / (100 - t);
            }
            right[k] = t * c[k];
        }
        if (can) map[left].push_back(i + 1);
        map[right].push_back(-i - 1);
    }

    bool ans{};
    for (const auto& [_, index] : map) {
        std::vector<int> pos, neg;
        for (auto x : index) {
            if (x > 0) pos.push_back(x);
            else if (x < 0) neg.push_back(x);
            else assert(false);
        }
        if (neg.empty()) continue;
        for (auto v : pos) {
            ans |= neg[0] * -1 != v;
            ans |= (neg.size() > 1u and neg[1] * -1 != v);
        }
    }
    std::cout << (ans ? "Yes" : "No") << '\n';
}
0