結果
問題 | No.2684 折々の色 |
ユーザー | nikoro256 |
提出日時 | 2024-03-22 18:01:35 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,018 bytes |
コンパイル時間 | 408 ms |
コンパイル使用メモリ | 81,700 KB |
実行使用メモリ | 226,176 KB |
最終ジャッジ日時 | 2024-03-22 18:02:19 |
合計ジャッジ時間 | 42,745 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 35 ms
53,460 KB |
testcase_01 | AC | 37 ms
53,460 KB |
testcase_02 | AC | 54 ms
65,824 KB |
testcase_03 | AC | 36 ms
53,460 KB |
testcase_04 | AC | 72 ms
73,556 KB |
testcase_05 | AC | 35 ms
53,460 KB |
testcase_06 | AC | 65 ms
69,976 KB |
testcase_07 | AC | 37 ms
53,460 KB |
testcase_08 | AC | 67 ms
72,300 KB |
testcase_09 | AC | 46 ms
61,564 KB |
testcase_10 | AC | 56 ms
65,832 KB |
testcase_11 | AC | 1,338 ms
149,304 KB |
testcase_12 | AC | 749 ms
127,172 KB |
testcase_13 | AC | 807 ms
161,248 KB |
testcase_14 | AC | 430 ms
117,948 KB |
testcase_15 | AC | 839 ms
131,660 KB |
testcase_16 | AC | 254 ms
87,012 KB |
testcase_17 | AC | 727 ms
121,156 KB |
testcase_18 | AC | 850 ms
167,584 KB |
testcase_19 | AC | 1,023 ms
162,360 KB |
testcase_20 | AC | 622 ms
132,008 KB |
testcase_21 | AC | 350 ms
94,440 KB |
testcase_22 | AC | 1,351 ms
168,476 KB |
testcase_23 | AC | 1,317 ms
136,880 KB |
testcase_24 | AC | 561 ms
104,968 KB |
testcase_25 | AC | 844 ms
120,388 KB |
testcase_26 | AC | 1,698 ms
155,180 KB |
testcase_27 | AC | 1,056 ms
126,624 KB |
testcase_28 | AC | 1,274 ms
136,624 KB |
testcase_29 | TLE | - |
testcase_30 | AC | 1,913 ms
212,188 KB |
testcase_31 | AC | 1,117 ms
212,728 KB |
testcase_32 | TLE | - |
testcase_33 | AC | 1,689 ms
218,984 KB |
testcase_34 | TLE | - |
testcase_35 | TLE | - |
testcase_36 | AC | 1,213 ms
212,084 KB |
testcase_37 | AC | 1,587 ms
212,592 KB |
testcase_38 | TLE | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
testcase_52 | -- | - |
testcase_53 | -- | - |
testcase_54 | -- | - |
testcase_55 | -- | - |
testcase_56 | -- | - |
testcase_57 | -- | - |
ソースコード
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 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]*mod_inv(100,p) 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 for j in range(M): C[i][j]*=T[i]*mod_inv(100,p)%p C[i][j]%=p C[i][j]=X[j]-C[i][j] C[i][j]%=p C[i][j]*=mod_inv((1-T[i]*mod_inv(100,p))%p,p) C[i][j]%=p if tuple(C[i]) in Cset: print('Yes') exit(0) print('No')