結果

問題 No.2684 折々の色
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-12-17 05:09:54
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,614 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 270,156 KB
最終ジャッジ日時 2024-03-07 02:22:06
合計ジャッジ時間 53,712 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 46 ms
62,208 KB
testcase_03 AC 52 ms
66,536 KB
testcase_04 AC 60 ms
68,580 KB
testcase_05 AC 44 ms
62,080 KB
testcase_06 AC 46 ms
62,216 KB
testcase_07 AC 45 ms
62,100 KB
testcase_08 AC 58 ms
66,388 KB
testcase_09 AC 50 ms
64,164 KB
testcase_10 AC 52 ms
66,388 KB
testcase_11 AC 791 ms
142,792 KB
testcase_12 AC 918 ms
142,012 KB
testcase_13 AC 847 ms
148,456 KB
testcase_14 AC 387 ms
105,788 KB
testcase_15 AC 837 ms
131,688 KB
testcase_16 AC 304 ms
87,492 KB
testcase_17 AC 712 ms
123,708 KB
testcase_18 AC 826 ms
146,020 KB
testcase_19 AC 745 ms
144,712 KB
testcase_20 AC 476 ms
116,924 KB
testcase_21 AC 492 ms
97,092 KB
testcase_22 AC 1,644 ms
200,804 KB
testcase_23 AC 1,014 ms
158,504 KB
testcase_24 AC 647 ms
111,972 KB
testcase_25 AC 844 ms
131,260 KB
testcase_26 AC 1,325 ms
188,068 KB
testcase_27 AC 898 ms
143,676 KB
testcase_28 AC 1,013 ms
156,324 KB
testcase_29 AC 1,998 ms
267,088 KB
testcase_30 TLE -
testcase_31 AC 584 ms
147,448 KB
testcase_32 AC 1,730 ms
243,404 KB
testcase_33 TLE -
testcase_34 AC 1,547 ms
226,808 KB
testcase_35 AC 1,546 ms
224,372 KB
testcase_36 AC 530 ms
141,300 KB
testcase_37 AC 934 ms
176,120 KB
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 AC 50 ms
64,164 KB
testcase_48 AC 42 ms
61,972 KB
testcase_49 AC 42 ms
61,972 KB
testcase_50 AC 42 ms
62,100 KB
testcase_51 AC 50 ms
64,168 KB
testcase_52 AC 49 ms
64,432 KB
testcase_53 AC 53 ms
66,540 KB
testcase_54 AC 45 ms
62,356 KB
testcase_55 AC 44 ms
62,356 KB
testcase_56 AC 36 ms
53,460 KB
testcase_57 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

10000X = 100tc + (100-t)TC

10000X = 100tc + 100TC - tTC

10000X-100TC = t(100c-TC)

tが100以下なので、tを決め打てば cは決まる
枝刈でも通らない?

"""

import sys
from sys import stdin

N,M = map(int,stdin.readline().split())

X = list(map(int,stdin.readline().split()))

C = []
T = []

able_t = [i+1 for i in range(100)]

for i in range(N):

    CT = list(map(int,stdin.readline().split()))
    c,t = CT[:-1],CT[-1]
    
    C.append( c )
    T.append( t )



dic = [set() for i in range(101)]


for cj,tj in zip(C,T):

    for ti in able_t:

        colori = []
        for k in range(M):
            L = 10000*X[k] - 100*cj[k]*tj
            if L % ti != 0:
                break
            tmp = L // ti + tj*cj[k]
            if tmp % 100 == 0:
                colori.append(tmp // 100)
            else:
                break
        else:
            colori = tuple(colori)
            if colori in dic[ti]:
                print ("Yes")
                sys.exit()

    dic[tj].add(tuple(cj))

C.reverse()
T.reverse()


dic = [set() for i in range(101)]

for cj,tj in zip(C,T):

    for ti in able_t:

        colori = []
        for k in range(M):
            L = 10000*X[k] - 100*cj[k]*tj
            if L % ti != 0:
                break
            tmp = L // ti + tj*cj[k]
            if tmp % 100 == 0:
                colori.append(tmp // 100)
            else:
                break
        else:
            colori = tuple(colori)
            if colori in dic[ti]:
                print ("Yes")
                sys.exit()

    dic[tj].add(tuple(cj))


print ("No")
0