結果
問題 | No.2196 Pair Bonus |
ユーザー | vwxyz |
提出日時 | 2023-07-10 00:51:46 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 303 ms / 2,000 ms |
コード長 | 978 bytes |
コンパイル時間 | 100 ms |
コンパイル使用メモリ | 10,860 KB |
実行使用メモリ | 42,432 KB |
最終ジャッジ日時 | 2023-10-01 04:53:55 |
合計ジャッジ時間 | 5,302 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 33 ms
10,436 KB |
testcase_01 | AC | 33 ms
10,420 KB |
testcase_02 | AC | 34 ms
10,408 KB |
testcase_03 | AC | 303 ms
42,432 KB |
testcase_04 | AC | 303 ms
41,548 KB |
testcase_05 | AC | 34 ms
10,596 KB |
testcase_06 | AC | 34 ms
10,524 KB |
testcase_07 | AC | 35 ms
10,452 KB |
testcase_08 | AC | 75 ms
16,284 KB |
testcase_09 | AC | 288 ms
40,396 KB |
testcase_10 | AC | 194 ms
29,520 KB |
testcase_11 | AC | 87 ms
17,484 KB |
testcase_12 | AC | 246 ms
35,532 KB |
testcase_13 | AC | 35 ms
10,668 KB |
testcase_14 | AC | 55 ms
13,232 KB |
testcase_15 | AC | 35 ms
10,860 KB |
testcase_16 | AC | 275 ms
40,936 KB |
testcase_17 | AC | 37 ms
10,988 KB |
ソースコード
import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys import time from collections import Counter,deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines write=sys.stdout.write N=int(readline()) A=list(map(int,readline().split())) B=list(map(int,readline().split())) X=list(map(int,readline().split())) Y=list(map(int,readline().split())) ans=sum(max(A[2*i]+A[2*i+1]+X[i],B[2*i]+A[2*i+1]+Y[i],A[2*i]+B[2*i+1]+Y[i],B[2*i]+B[2*i+1]+X[i]) for i in range(N)) print(ans)