题解列表
一道简单的数学题(非常短且绝对能听懂)
摘要:解题思路:对于每一对恰好前后颠倒的排列(比如1 3 2 4与4 2 3 1),其价值和为n*(n-1)/2,可以自己尝试一下,会发现很好证明。一共有n!个排列,也就是n!/2对排列,所以答案就是n*(……
差分与前缀和,时间复杂度O(nlogn)
摘要:解题思路:代码和注释已经很清晰了注意事项:参考代码:#include<bits/stdc++.h>using namespace std;#define maxn 100010#define maxm……
1081: Infinite Dictionaries
摘要:```cpp
#include
#include
#include
using namespace std;
struct rec
{
int flag,x,z;
st……
1080: 战场的数目
摘要:```cpp
#include
#include
using namespace std;
typedef long long LL;
const LL mod=987654321;
LL……
1079: 射击游戏
摘要:```cpp
#include
#include
#include
using namespace std;
int n;
double dp[7][7][7][7][7][7];
do……