题目链接:Problem - G1 - Codeforces
题目大意:给定一个序列, 求三元组个个数, 三元组(ai, aj, ak)满足 ai * b aj, aj * b ak. 及等比数列但只要三个,同时i,j, k 的大小顺序不管…
做法1
参考BLOG 引理:
设 z e r o zero zero为0的个数.则 a n s ≤ m z e r o 2 ans\le m\dfrac {zero} 2 ans≤m2zero.我们把下标划分成两个集合 L , R L,R L,R,其中 L L L集合内的元素左边的0的个数 ≤ m \le m ≤m. 原问题等价于每一个非0数如果成功和两边的0配对,那么…
链接:https://ac.nowcoder.com/acm/contest/884/D?&headNavacm&headNavacm 来源:牛客网 题目描述 Doctor Elephant is testing his new program: output the bitwise or of the numbers inputed. He has decided to input several multiples o…