結果

問題 No.2684 折々の色
ユーザー 👑 rin204rin204
提出日時 2024-02-29 22:02:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 729 ms / 2,000 ms
コード長 1,016 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 249,292 KB
最終ジャッジ日時 2024-09-29 18:31:04
合計ジャッジ時間 23,136 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,964 KB
testcase_01 AC 32 ms
53,368 KB
testcase_02 AC 35 ms
54,540 KB
testcase_03 AC 33 ms
53,184 KB
testcase_04 AC 37 ms
53,660 KB
testcase_05 AC 34 ms
52,988 KB
testcase_06 AC 38 ms
54,788 KB
testcase_07 AC 34 ms
53,432 KB
testcase_08 AC 35 ms
54,676 KB
testcase_09 AC 40 ms
54,536 KB
testcase_10 AC 35 ms
54,384 KB
testcase_11 AC 390 ms
156,804 KB
testcase_12 AC 308 ms
133,108 KB
testcase_13 AC 474 ms
178,416 KB
testcase_14 AC 261 ms
120,676 KB
testcase_15 AC 337 ms
139,280 KB
testcase_16 AC 152 ms
92,888 KB
testcase_17 AC 276 ms
126,856 KB
testcase_18 AC 444 ms
187,112 KB
testcase_19 AC 455 ms
173,760 KB
testcase_20 AC 323 ms
136,860 KB
testcase_21 AC 194 ms
99,532 KB
testcase_22 AC 494 ms
188,096 KB
testcase_23 AC 364 ms
145,996 KB
testcase_24 AC 238 ms
108,748 KB
testcase_25 AC 283 ms
124,652 KB
testcase_26 AC 423 ms
171,216 KB
testcase_27 AC 297 ms
130,160 KB
testcase_28 AC 340 ms
145,852 KB
testcase_29 AC 662 ms
244,824 KB
testcase_30 AC 645 ms
243,912 KB
testcase_31 AC 643 ms
244,020 KB
testcase_32 AC 719 ms
248,092 KB
testcase_33 AC 673 ms
248,672 KB
testcase_34 AC 660 ms
242,664 KB
testcase_35 AC 663 ms
243,724 KB
testcase_36 AC 645 ms
243,916 KB
testcase_37 AC 657 ms
243,996 KB
testcase_38 AC 729 ms
249,156 KB
testcase_39 AC 719 ms
248,936 KB
testcase_40 AC 699 ms
248,920 KB
testcase_41 AC 726 ms
249,292 KB
testcase_42 AC 712 ms
249,012 KB
testcase_43 AC 698 ms
249,004 KB
testcase_44 AC 722 ms
248,756 KB
testcase_45 AC 698 ms
248,936 KB
testcase_46 AC 706 ms
249,284 KB
testcase_47 AC 36 ms
53,416 KB
testcase_48 AC 38 ms
53,872 KB
testcase_49 AC 36 ms
54,392 KB
testcase_50 AC 33 ms
53,980 KB
testcase_51 AC 34 ms
53,480 KB
testcase_52 AC 35 ms
54,600 KB
testcase_53 AC 34 ms
53,156 KB
testcase_54 AC 33 ms
53,628 KB
testcase_55 AC 35 ms
53,128 KB
testcase_56 AC 32 ms
53,800 KB
testcase_57 AC 33 ms
52,476 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