結果

問題 No.2684 折々の色
ユーザー hato336hato336
提出日時 2024-03-20 22:44:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,551 ms / 2,000 ms
コード長 1,405 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 164,444 KB
最終ジャッジ日時 2024-03-20 22:45:54
合計ジャッジ時間 41,961 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
84,920 KB
testcase_01 AC 135 ms
84,920 KB
testcase_02 AC 151 ms
88,248 KB
testcase_03 AC 147 ms
88,248 KB
testcase_04 AC 148 ms
88,248 KB
testcase_05 AC 130 ms
84,920 KB
testcase_06 AC 145 ms
88,248 KB
testcase_07 AC 134 ms
84,920 KB
testcase_08 AC 148 ms
88,248 KB
testcase_09 AC 144 ms
88,248 KB
testcase_10 AC 149 ms
88,248 KB
testcase_11 AC 716 ms
118,972 KB
testcase_12 AC 480 ms
111,948 KB
testcase_13 AC 607 ms
125,944 KB
testcase_14 AC 406 ms
105,528 KB
testcase_15 AC 495 ms
117,332 KB
testcase_16 AC 254 ms
97,464 KB
testcase_17 AC 451 ms
109,624 KB
testcase_18 AC 500 ms
142,648 KB
testcase_19 AC 694 ms
124,996 KB
testcase_20 AC 576 ms
114,672 KB
testcase_21 AC 290 ms
103,352 KB
testcase_22 AC 574 ms
130,920 KB
testcase_23 AC 714 ms
119,116 KB
testcase_24 AC 326 ms
107,448 KB
testcase_25 AC 474 ms
109,968 KB
testcase_26 AC 837 ms
128,800 KB
testcase_27 AC 581 ms
110,360 KB
testcase_28 AC 681 ms
118,904 KB
testcase_29 AC 1,293 ms
161,012 KB
testcase_30 AC 1,153 ms
161,276 KB
testcase_31 AC 974 ms
156,956 KB
testcase_32 AC 1,469 ms
161,992 KB
testcase_33 AC 1,173 ms
158,896 KB
testcase_34 AC 1,231 ms
161,500 KB
testcase_35 AC 1,227 ms
161,668 KB
testcase_36 AC 980 ms
156,480 KB
testcase_37 AC 1,045 ms
157,196 KB
testcase_38 AC 1,551 ms
164,316 KB
testcase_39 AC 1,528 ms
164,180 KB
testcase_40 AC 1,527 ms
164,308 KB
testcase_41 AC 1,536 ms
164,188 KB
testcase_42 AC 1,526 ms
164,320 KB
testcase_43 AC 1,535 ms
164,440 KB
testcase_44 AC 1,521 ms
164,444 KB
testcase_45 AC 1,516 ms
164,188 KB
testcase_46 AC 1,529 ms
164,124 KB
testcase_47 AC 144 ms
88,248 KB
testcase_48 AC 146 ms
88,248 KB
testcase_49 AC 142 ms
88,248 KB
testcase_50 AC 143 ms
88,248 KB
testcase_51 AC 144 ms
88,248 KB
testcase_52 AC 145 ms
88,248 KB
testcase_53 AC 144 ms
88,248 KB
testcase_54 AC 146 ms
88,248 KB
testcase_55 AC 143 ms
88,248 KB
testcase_56 AC 134 ms
84,920 KB
testcase_57 AC 134 ms
84,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
n,m = map(int,input().split())
mod = 2**61-1
base = 98765
x = list(map(int,input().split()))
for i in range(m):
    x[i] *= 10000
c = [list(map(int,input().split())) for i in range(n)]
s = collections.defaultdict(int)
for i in range(n):
    z = 0
    for j in range(m):
        z += (1 * c[i][-1] * c[i][j]) * (pow(base,j,mod))
        z %= mod
    s[z] += 1

for i in range(n):
    if 100 - c[i][-1] == 0:
        cnt = 0
        for j in range(m):
            if x[j] == 100 * c[i][j] * c[i][-1]:
                cnt += 1
            else:
                break
        if cnt == m:
            print('Yes')
            exit()
        continue
    z = 0
    for j in range(m):
        z += (1 * c[i][-1] * c[i][j]) * (pow(base,j,mod))
        z %= mod
    s[z] -= 1
    y = []
    for j in range(m):
        y.append(x[j] - 100*c[i][-1]*c[i][j])
    check = 1
    for j in range(m):
        if y[j] % (100 - c[i][-1]) != 0:
            check = 0
            break
        else:
            y[j] //= (100 - c[i][-1])
    if check == 0:
        s[z] += 1
        continue
    v = 0
    for j in range(m):
        v += y[j] * pow(base,j,mod)
        v %= mod
    #print(i,y,s)
    if s[v] >= 1:
        exit(print('Yes'))
    s[z] += 1
print('No')
0