E. XOR and Favorite Number time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pai…
链接: https://vjudge.net/contest/308446#problem/C 题意: Chika gives you an integer sequence a1,a2,-,an and m tasks. For each task, you need to answer the number of " friendly pairs" in a given interval. friendly pair: for two integers ai and aj, if…
Description Give you a sequence consisted of n numbers. You are required to answer how many pairs of numbers (ai, aj) satisfy that | ai - aj | <= 2 and L <= i < j <= R. Input The input consists of one or more test cases. For each case, the fir…