結果

問題 No.2684 折々の色
ユーザー flygonflygon
提出日時 2024-03-20 22:59:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 836 ms / 2,000 ms
コード長 978 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 201,324 KB
最終ジャッジ日時 2024-03-20 23:00:02
合計ジャッジ時間 26,257 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
55,720 KB
testcase_01 AC 44 ms
55,720 KB
testcase_02 AC 47 ms
57,800 KB
testcase_03 AC 45 ms
55,720 KB
testcase_04 AC 47 ms
57,800 KB
testcase_05 AC 44 ms
55,720 KB
testcase_06 AC 46 ms
55,720 KB
testcase_07 AC 46 ms
55,720 KB
testcase_08 AC 46 ms
55,720 KB
testcase_09 AC 45 ms
55,720 KB
testcase_10 AC 46 ms
55,720 KB
testcase_11 AC 455 ms
132,940 KB
testcase_12 AC 325 ms
116,324 KB
testcase_13 AC 490 ms
145,312 KB
testcase_14 AC 298 ms
109,668 KB
testcase_15 AC 344 ms
117,092 KB
testcase_16 AC 168 ms
86,128 KB
testcase_17 AC 305 ms
112,484 KB
testcase_18 AC 481 ms
147,012 KB
testcase_19 AC 501 ms
145,176 KB
testcase_20 AC 379 ms
120,932 KB
testcase_21 AC 181 ms
92,144 KB
testcase_22 AC 449 ms
147,352 KB
testcase_23 AC 357 ms
125,796 KB
testcase_24 AC 214 ms
100,964 KB
testcase_25 AC 274 ms
110,180 KB
testcase_26 AC 454 ms
140,516 KB
testcase_27 AC 312 ms
115,428 KB
testcase_28 AC 361 ms
124,004 KB
testcase_29 AC 784 ms
200,900 KB
testcase_30 AC 793 ms
194,224 KB
testcase_31 AC 758 ms
194,460 KB
testcase_32 AC 783 ms
200,572 KB
testcase_33 AC 828 ms
201,324 KB
testcase_34 AC 769 ms
194,096 KB
testcase_35 AC 777 ms
194,040 KB
testcase_36 AC 792 ms
194,200 KB
testcase_37 AC 780 ms
194,244 KB
testcase_38 AC 784 ms
201,076 KB
testcase_39 AC 836 ms
201,068 KB
testcase_40 AC 809 ms
201,072 KB
testcase_41 AC 791 ms
201,068 KB
testcase_42 AC 818 ms
201,072 KB
testcase_43 AC 783 ms
201,072 KB
testcase_44 AC 817 ms
201,072 KB
testcase_45 AC 811 ms
201,072 KB
testcase_46 AC 812 ms
201,076 KB
testcase_47 AC 44 ms
55,720 KB
testcase_48 AC 44 ms
55,720 KB
testcase_49 AC 47 ms
55,720 KB
testcase_50 AC 45 ms
55,720 KB
testcase_51 AC 45 ms
55,720 KB
testcase_52 AC 44 ms
55,720 KB
testcase_53 AC 44 ms
55,720 KB
testcase_54 AC 44 ms
55,720 KB
testcase_55 AC 45 ms
55,720 KB
testcase_56 AC 43 ms
55,720 KB
testcase_57 AC 44 ms
55,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n,m = map(int,input().split())
x = list(map(int,input().split()))
c = []
t = []
for i in range(n):
    l = list(map(int,input().split()))
    c.append(l[:-1])
    t.append(l[-1])

jj = set()
for i in range(n):
    l = []
    for j in range(m):
        l.append(c[i][j]*t[i])
    l = tuple(l)
    jj.add(l)


ans = 0
for i in range(n):
    l = []
    for j in range(m):
        l.append(c[i][j]*t[i])
    l = tuple(l)

    if t[i] == 100:
        ans |= tuple(c[i]) == tuple(x)
        continue
    e = []
    ok = 1
    for j in range(m):
        a = 10000*x[j] - 100*t[i]*c[i][j]
        b = 100-t[i]
        ok &= a % b == 0
        e.append(a//b)
    ok &= tuple(e) != l
    if ok:
        ans |= (tuple(e) in jj)

print('Yes') if ans else print('No')
0