結果
| 問題 | No.2684 折々の色 | 
| コンテスト | |
| ユーザー |  mymelochan | 
| 提出日時 | 2024-03-20 22:31:14 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,494 bytes | 
| コンパイル時間 | 352 ms | 
| コンパイル使用メモリ | 82,532 KB | 
| 実行使用メモリ | 279,684 KB | 
| 最終ジャッジ日時 | 2024-09-30 08:32:51 | 
| 合計ジャッジ時間 | 29,021 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 55 WA * 1 | 
ソースコード
#############################################################
import sys
sys.setrecursionlimit(10**7)
from heapq import heappop,heappush
from collections import deque,defaultdict,Counter
from bisect import bisect_left, bisect_right
from itertools import product,combinations,permutations
ipt = sys.stdin.readline
def iin():
    return int(ipt())
def lmin():
    return list(map(int,ipt().split()))
MOD = 998244353
#############################################################
N,M = lmin()
X = lmin()
C = []
T = []
for i in range(N):
    L = lmin()
    C.append(tuple(L[:-1]))
    T.append(L[-1])
S = set()
for i in range(N):
    if T[i] == 100:
        if X == C:
            print("Yes")
            exit()
    tpl = []
    for j in range(M):
        u = 10000*X[j]-100*T[i]*C[i][j]
        d = 100-T[i]
        if d == 0:
            break
        if u%d != 0:
            break
        tpl.append(u//d)
    else:
        tpl = tuple(tpl)
        if tpl in S:
            print("Yes")
            exit()
    S.add(tuple(C[i][j]*T[i] for j in range(M)))
C.reverse()
T.reverse()
S = set()
for i in range(N):
    tpl = []
    for j in range(M):
        u = 10000*X[j]-100*T[i]*C[i][j]
        d = 100-T[i]
        if d == 0:
            break
        if u%d != 0:
            break
        tpl.append(u//d)
    else:
        tpl = tuple(tpl)
        if tpl in S:
            print("Yes")
            exit()
            
    S.add(tuple(C[i][j]*T[i] for j in range(M)))
print("No")
            
            
            
        