結果

問題 No.2656 XOR Slimes
ユーザー chineristACchineristAC
提出日時 2024-03-01 21:50:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 71,316 KB
最終ジャッジ日時 2024-03-01 21:51:04
合計ジャッジ時間 12,560 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
56,112 KB
testcase_01 AC 45 ms
56,112 KB
testcase_02 AC 54 ms
56,112 KB
testcase_03 AC 48 ms
56,112 KB
testcase_04 AC 45 ms
56,112 KB
testcase_05 AC 45 ms
56,112 KB
testcase_06 AC 44 ms
56,112 KB
testcase_07 AC 44 ms
56,112 KB
testcase_08 AC 159 ms
71,316 KB
testcase_09 AC 158 ms
71,316 KB
testcase_10 AC 158 ms
71,316 KB
testcase_11 AC 255 ms
71,316 KB
testcase_12 AC 245 ms
71,316 KB
testcase_13 AC 246 ms
71,316 KB
testcase_14 AC 160 ms
71,316 KB
testcase_15 AC 160 ms
71,316 KB
testcase_16 AC 161 ms
71,316 KB
testcase_17 AC 160 ms
71,316 KB
testcase_18 AC 163 ms
71,316 KB
testcase_19 AC 160 ms
71,316 KB
testcase_20 AC 159 ms
71,316 KB
testcase_21 AC 246 ms
71,316 KB
testcase_22 AC 157 ms
71,316 KB
testcase_23 AC 246 ms
71,316 KB
testcase_24 AC 165 ms
71,316 KB
testcase_25 AC 246 ms
71,316 KB
testcase_26 AC 246 ms
71,316 KB
testcase_27 AC 160 ms
71,316 KB
testcase_28 AC 247 ms
71,316 KB
testcase_29 AC 160 ms
71,316 KB
testcase_30 AC 259 ms
71,316 KB
testcase_31 AC 245 ms
71,316 KB
testcase_32 AC 158 ms
71,316 KB
testcase_33 AC 249 ms
71,316 KB
testcase_34 AC 246 ms
71,316 KB
testcase_35 AC 158 ms
71,316 KB
testcase_36 AC 159 ms
71,316 KB
testcase_37 AC 158 ms
71,316 KB
testcase_38 AC 246 ms
71,316 KB
testcase_39 AC 246 ms
71,316 KB
testcase_40 AC 175 ms
71,316 KB
testcase_41 AC 159 ms
71,316 KB
testcase_42 AC 245 ms
71,316 KB
testcase_43 AC 246 ms
71,312 KB
testcase_44 AC 245 ms
71,312 KB
testcase_45 AC 245 ms
71,312 KB
testcase_46 AC 245 ms
71,312 KB
testcase_47 AC 246 ms
71,312 KB
testcase_48 AC 178 ms
71,312 KB
testcase_49 AC 157 ms
71,312 KB
testcase_50 AC 245 ms
71,308 KB
testcase_51 AC 246 ms
71,308 KB
testcase_52 AC 157 ms
71,308 KB
testcase_53 AC 158 ms
71,308 KB
testcase_54 AC 158 ms
71,308 KB
testcase_55 AC 157 ms
71,308 KB
testcase_56 AC 159 ms
71,308 KB
testcase_57 AC 160 ms
71,308 KB
testcase_58 AC 272 ms
71,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import permutations
from heapq import heappop,heappush
from collections import deque
import random
import bisect

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())



N = int(input())
X = li()
A = li()

INF = 3 * 10**9
dp = [INF] * (N+1)
dp[0] = 0
for l in range(N):
    tmp_xor = A[l]
    for r in range(l+1,N+1):
        dp[r] = min(dp[r],dp[l]+X[r-1]-X[l]+tmp_xor)
        if r!=N:
            tmp_xor ^= A[r]

print(dp[-1])

0