結果

問題 No.2684 折々の色
コンテスト
ユーザー flygon
提出日時 2024-03-20 22:55:50
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 1,048 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 232 ms
コンパイル使用メモリ 95,948 KB
実行使用メモリ 210,156 KB
最終ジャッジ日時 2026-09-06 15:32:35
合計ジャッジ時間 27,482 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 55 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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()
kaburi = set()
for i in range(n):
    l = []
    for j in range(m):
        l.append(c[i][j]*t[i])
    l = tuple(l)
    if l in jj:
        kaburi.add(i)
    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 |= l == 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)
    if i not in kaburi:
        ok &= tuple(e) != l
    if ok:
        ans |= (tuple(e) in jj)

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