結果

問題 No.2684 折々の色
ユーザー flygon
提出日時 2024-03-20 22:28:42
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 876 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 202,092 KB
最終ジャッジ日時 2024-09-30 08:27:35
合計ジャッジ時間 17,857 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 1 RE * 46
権限があれば一括ダウンロードができます

ソースコード

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)
    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)
    if ok:
        ans |= (tuple(e) in jj)

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