結果

問題 No.2684 折々の色
ユーザー nikoro256nikoro256
提出日時 2024-03-22 18:04:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,030 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 212,308 KB
最終ジャッジ日時 2024-03-22 18:04:31
合計ジャッジ時間 28,916 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 34 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 44 ms
61,564 KB
testcase_05 AC 37 ms
53,460 KB
testcase_06 AC 39 ms
53,460 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 AC 41 ms
58,804 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 39 ms
53,460 KB
testcase_11 AC 555 ms
140,564 KB
testcase_12 AC 340 ms
118,304 KB
testcase_13 AC 452 ms
151,740 KB
testcase_14 AC 272 ms
108,944 KB
testcase_15 AC 393 ms
122,408 KB
testcase_16 AC 182 ms
86,608 KB
testcase_17 AC 319 ms
114,208 KB
testcase_18 AC 512 ms
159,588 KB
testcase_19 AC 467 ms
153,740 KB
testcase_20 AC 314 ms
124,792 KB
testcase_21 AC 235 ms
91,440 KB
testcase_22 AC 605 ms
160,608 KB
testcase_23 AC 439 ms
128,560 KB
testcase_24 AC 275 ms
99,656 KB
testcase_25 AC 325 ms
113,180 KB
testcase_26 AC 549 ms
147,124 KB
testcase_27 AC 365 ms
118,104 KB
testcase_28 AC 413 ms
128,184 KB
testcase_29 AC 805 ms
210,256 KB
testcase_30 AC 787 ms
205,276 KB
testcase_31 AC 656 ms
205,532 KB
testcase_32 AC 967 ms
211,280 KB
testcase_33 AC 732 ms
211,156 KB
testcase_34 AC 758 ms
204,512 KB
testcase_35 AC 778 ms
205,148 KB
testcase_36 AC 644 ms
204,764 KB
testcase_37 AC 689 ms
205,660 KB
testcase_38 AC 933 ms
211,920 KB
testcase_39 AC 910 ms
211,924 KB
testcase_40 AC 896 ms
211,920 KB
testcase_41 AC 924 ms
211,924 KB
testcase_42 AC 926 ms
211,920 KB
testcase_43 AC 954 ms
212,308 KB
testcase_44 AC 900 ms
211,920 KB
testcase_45 AC 915 ms
211,924 KB
testcase_46 AC 928 ms
211,924 KB
testcase_47 AC 38 ms
53,460 KB
testcase_48 AC 37 ms
53,460 KB
testcase_49 AC 37 ms
53,460 KB
testcase_50 AC 38 ms
53,460 KB
testcase_51 AC 37 ms
53,460 KB
testcase_52 AC 38 ms
53,460 KB
testcase_53 AC 38 ms
53,460 KB
testcase_54 AC 37 ms
53,460 KB
testcase_55 AC 38 ms
53,460 KB
testcase_56 WA -
testcase_57 AC 37 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def extgcd(a, b):
    if b:
        d, y, x = extgcd(b, a % b)
        y -= (a // b) * x
        return d, x, y
    return a, 1, 0

#以下modinv
def mod_inv(a, m):
    g, x, y = extgcd(a, m)

    if g != 1:
        raise Exception()

    if x < 0:
        x += m

    return x

import sys
input=sys.stdin.readline
N,M=map(int,input().split())
X=list(map(int,input().split()))
C=[]
T=[]
Cset=set()
p=998244353
inv100=mod_inv(100,p)
for i in range(N):
    c=list(map(int,input().split()))
    C.append(c[:-1])
    T.append(c[-1])
    Ct=c[:-1]
    for i in range(M):
        Ct[i]*=T[-1]*inv100
        Ct[i]%=p
    Cset.add(tuple(Ct))
for i in range(N):
    if T[i]==100:
        if C[i]==X:
            print('Yes')
            exit(0)
        continue
    tinv=mod_inv((1-T[i]*inv100)%p,p)
    for j in range(M):
        C[i][j]*=T[i]*inv100%p
        C[i][j]%=p
        C[i][j]=X[j]-C[i][j]
        C[i][j]%=p
        C[i][j]*=tinv
        C[i][j]%=p
    if tuple(C[i]) in Cset:
        print('Yes')
        exit(0)
print('No')
0