大家都说这题水然而我好像还是调了有一会儿……不过暴力真的很良心,裸的暴力竟然还有60分. 打一张表出来,就会发现数据好像哪里有规律的样子,再仔细看一看,就会发现k/3~k/2为公差为2的等差数列,k/2~之后为公差为1的等差数列,于是我们就可以利用高斯求和快速求解啦.自认为代码是能够看得的... #include <bits/stdc++.h> using namespace std; #define LL long long #define int long long LL ans; , n…
A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, these are arithmetic sequence: 1, 3, 5, 7, 9 7, 7, 7, 7 3, -1, -5, -9 The followi…
5.7 An array A contains all the integers from 0 to n, except for one number which is missing. In this problem, we cannot access an entire integer in A with a single operation. The elements of A are represented in binary, and the only operation we can…