結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー 👑 KazunKazun
提出日時 2021-10-17 03:56:18
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 684 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 83,072 KB
実行使用メモリ 109,696 KB
最終ジャッジ日時 2024-04-16 13:48:41
合計ジャッジ時間 6,136 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
57,472 KB
testcase_01 AC 40 ms
52,224 KB
testcase_02 AC 40 ms
52,352 KB
testcase_03 AC 70 ms
66,176 KB
testcase_04 AC 131 ms
76,544 KB
testcase_05 AC 149 ms
76,544 KB
testcase_06 AC 76 ms
69,376 KB
testcase_07 AC 56 ms
62,080 KB
testcase_08 AC 73 ms
68,224 KB
testcase_09 AC 79 ms
70,528 KB
testcase_10 AC 85 ms
72,192 KB
testcase_11 AC 102 ms
76,288 KB
testcase_12 AC 200 ms
76,928 KB
testcase_13 AC 70 ms
67,200 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())

P=list(map(int,input().split()))

S=[]
for _ in range(N):
    a,b=map(int,input().split())
    S.append((a,b))

T=[]
for j in range(M):
    c,d=map(int,input().split())
    T.append((c,d))
T_set=set(T)


X=0
for s,t in [(1,1),(1,-1),(-1,1),(-1,-1)]:
    E=set()
    for i in range(N):
        a,b=S[i]
        for j in range(M):
            c,d=T[j]

            u=c-s*a; v=d-t*b

            if (u,v) in E:
                continue

            E.add((u,v))
            Y=0
            for k in range(N):
                x,y=S[k]
                if (s*x+u, t*y+v) in T_set:
                    Y+=P[k]

            if X<Y:
                X=Y

print(X)
0