02:线段树两次扫描 #include<bits/stdc++.h> #include<vector> using namespace std; #define maxn 300005 ];}a[maxn]; int n,m,K; int cmp1(Line &a,Line &b){return a.y<b.y;} int cmp2(Line &a,Line &b){return a.y>b.y;} int x[maxn],tot; #d…
pid=5288">http://acm.hdu.edu.cn/showproblem.php?pid=5288 Problem Description OO has got a array A of size n ,defined a function f(l,r) represent the number of i (l<=i<=r) , that there's no j(l<=j<=r,j<>i) satisfy ai mod aj=0,now…
转自:https://blog.csdn.net/CatDsy/article/details/81876341 #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define mst(a,b) memset((a),(b),sizeof(a)) #define pi acos(-1) #define pii pair<int,int>…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6308 Time Zone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5017 Accepted Submission(s): 1433 Problem Description Chiaki often participates in…
地址:http://acm.hdu.edu.cn/showproblem.php?pid=5768 Lucky7 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description When ?? was born, seven crows flew in and stopped beside him. In its childhood, ?? had be…
Rikka with Badminton Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 351 Accepted Submission(s): 219 Problem Description In the last semester, Rikka joined the badminton club. There are n s…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6625 题意: 给你两串数 a串,b串,让你一一配对XOR使得新的 C 串字典序最小. 思路: 首先这边有两个问题: 1. 我要怎么知道这两个数配对是最优的:一开始我也不明白(以为选择会有后效性),其实很简单,对 a 里的一个X,在 b 的01树里跑到的最优解Y也一定就是 b 的这个Y在 a 的01树里跑到的最优解X. 2. 如果现在两颗树里跑到的点的下一个只有一种选择的话,肯定就接着跑,但是如果现在…
链接:https://www.nowcoder.com/acm/contest/147/A 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 Niuniu has recently learned how to use Gaussian elimination to solve systems of linear equations. Given n and a[i], wh…
#include<bits/stdc++.h>using namespace std;const long long mod=1000000007,inv=570000004;long long i,j,n,m,a[1010]/*成功几率*/,sum=0,dp[1010][1010]/*动态规划*/,def[1010]//预处理;long long qpow(long long x,long long y,long long mod)//快速幂{ long long ans=1,tmp=…
链接:https://www.nowcoder.com/acm/contest/147/A来源:牛客网 Niuniu has recently learned how to use Gaussian elimination to solve systems of linear equations. Given n and a[i], where n is a power of 2, let's consider an n x n matrix A. The index of A[i][j] an…