結果

問題 No.2684 折々の色
ユーザー 👑 rin204rin204
提出日時 2024-02-29 22:02:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 867 ms / 2,000 ms
コード長 1,016 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 248,484 KB
最終ジャッジ日時 2024-03-07 02:22:33
合計ジャッジ時間 27,325 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 39 ms
53,460 KB
testcase_03 AC 38 ms
53,460 KB
testcase_04 AC 40 ms
55,592 KB
testcase_05 AC 36 ms
53,460 KB
testcase_06 AC 39 ms
53,460 KB
testcase_07 AC 41 ms
53,460 KB
testcase_08 AC 39 ms
53,460 KB
testcase_09 AC 38 ms
53,460 KB
testcase_10 AC 38 ms
53,460 KB
testcase_11 AC 469 ms
156,448 KB
testcase_12 AC 373 ms
132,072 KB
testcase_13 AC 556 ms
177,772 KB
testcase_14 AC 299 ms
119,996 KB
testcase_15 AC 399 ms
138,260 KB
testcase_16 AC 174 ms
92,276 KB
testcase_17 AC 338 ms
126,432 KB
testcase_18 AC 550 ms
186,596 KB
testcase_19 AC 529 ms
172,880 KB
testcase_20 AC 371 ms
136,200 KB
testcase_21 AC 222 ms
98,864 KB
testcase_22 AC 587 ms
187,536 KB
testcase_23 AC 409 ms
145,456 KB
testcase_24 AC 265 ms
108,908 KB
testcase_25 AC 336 ms
124,224 KB
testcase_26 AC 507 ms
170,620 KB
testcase_27 AC 363 ms
129,744 KB
testcase_28 AC 407 ms
145,324 KB
testcase_29 AC 811 ms
244,616 KB
testcase_30 AC 780 ms
243,240 KB
testcase_31 AC 801 ms
243,404 KB
testcase_32 AC 825 ms
247,676 KB
testcase_33 AC 843 ms
248,260 KB
testcase_34 AC 801 ms
242,184 KB
testcase_35 AC 812 ms
243,040 KB
testcase_36 AC 791 ms
243,312 KB
testcase_37 AC 805 ms
243,400 KB
testcase_38 AC 859 ms
248,476 KB
testcase_39 AC 860 ms
248,464 KB
testcase_40 AC 866 ms
248,476 KB
testcase_41 AC 867 ms
248,484 KB
testcase_42 AC 859 ms
248,472 KB
testcase_43 AC 856 ms
248,464 KB
testcase_44 AC 856 ms
248,480 KB
testcase_45 AC 857 ms
248,472 KB
testcase_46 AC 858 ms
248,472 KB
testcase_47 AC 38 ms
53,460 KB
testcase_48 AC 38 ms
53,460 KB
testcase_49 AC 37 ms
53,460 KB
testcase_50 AC 38 ms
53,456 KB
testcase_51 AC 38 ms
53,460 KB
testcase_52 AC 38 ms
53,460 KB
testcase_53 AC 37 ms
53,460 KB
testcase_54 AC 39 ms
53,460 KB
testcase_55 AC 38 ms
53,460 KB
testcase_56 AC 36 ms
53,460 KB
testcase_57 AC 37 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
assert 2 <= n <= 200000
assert 1 <= m <= 10
X = list(map(int, input().split()))
assert all(0 <= x < (1 << 16) for x in X)
C = []
T = []
for _ in range(n):
    C_ = list(map(int, input().split()))
    t = C_.pop()
    assert len(C_) == m
    assert 0 < t <= 100
    assert all(0 <= c < (1 << 16) for c in C_)

    T.append(t)
    C.append(C_)

inds = {}
for i in range(n):
    if T[i] == 100:
        if C[i] == X:
            print("Yes")
            exit()
    D = tuple(T[i] * c for c in C[i])
    inds.setdefault(D, []).append(i)

X = [x * 10000 for x in X]


for i in range(n):
    if T[i] == 100:
        continue
    D = [0] * m
    ok = True
    for j in range(m):
        D[j] = X[j] - 100 * T[i] * C[i][j]
        if D[j] % (100 - T[i]) != 0:
            ok = False
            break
        D[j] //= 100 - T[i]

    if ok:
        tup = tuple(D)
        if tup in inds and (len(inds[tup]) > 1 or inds[tup][0] != i):
            print("Yes")
            exit()

print("No")
0