题目链接 题意:给定两个长度为n的数组a与长度为m的数组b, 给定一个操作符op满足 x op y = x < y ? x+y : x-y. 有q个询问,每次给出询问c,问:有多少对(i, j)满足a[i] op b[j] = c ? 0 <= c <= 100000, 其余数据范围在[0, 50000]. 题解:问题的关键在于如何分隔开 x < y与x >= y. cdq分治,合并的时候a[l, mid]与b[mid+1, r]卷积一次计算a[] < b[] , a…
Shell Necklace Time Limit: 16000/8000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 647 Accepted Submission(s): 287 Problem Description Perhaps the sea‘s definition of a shell is the pearl. However, in my view,…