Submission #3764803


Source Code Expand

def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
import math
import bisect
n=i1()
a=i2()
b=i2()
if max(max(a),max(b)):
 K=int(math.log2(max(max(a),max(b))))+1
 j=0
 for k in range(K+1):
  bb=[]
  for i in range(len(b)):
   bb.append(b[i]%(2**(k+1)))
  bb.sort()
  jj=0
  for i in a:
   x=i%(2**(k+1))
   jj+=(bisect.bisect_left(bb, 2**(k+1)-x)-bisect.bisect_left(bb, 2**k-x))
   jj+=(bisect.bisect_left(bb, (2**k)*4-x)-bisect.bisect_left(bb, (2**k)*3-x))
  print(jj,k)
  j+=(jj%2)*(2**k)
 print(j)
else:
 print(0)

Submission Info

Submission Time
Task D - Two Sequences
User tacloth
Language Python (3.4.3)
Score 0
Code Size 573 Byte
Status WA
Exec Time 3157 ms
Memory 37076 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 1
WA × 3
AC × 1
WA × 7
TLE × 8
Set Name Test Cases
Sample example_0, example_1, example_2, example_3
All N100000_0, N100000_1, N150000_0, N150000_1, N200000_0, N200000_1, N200000_ex_0, N200000_ex_1, example_0, example_1, example_2, example_3, rand_0, rand_1, smallrand_0, smallrand_1
Case Name Status Exec Time Memory
N100000_0 TLE 3156 ms 19276 KB
N100000_1 TLE 3156 ms 18336 KB
N150000_0 TLE 3157 ms 27252 KB
N150000_1 TLE 3157 ms 27260 KB
N200000_0 TLE 3157 ms 34988 KB
N200000_1 TLE 3157 ms 37076 KB
N200000_ex_0 TLE 3157 ms 33488 KB
N200000_ex_1 TLE 3156 ms 37076 KB
example_0 WA 17 ms 3064 KB
example_1 WA 17 ms 3064 KB
example_2 WA 17 ms 3064 KB
example_3 AC 17 ms 3064 KB
rand_0 WA 761 ms 4080 KB
rand_1 WA 1629 ms 5108 KB
smallrand_0 WA 17 ms 3064 KB
smallrand_1 WA 17 ms 3064 KB