自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 hdu 5831 栈+模拟

点击打开链接 #include #include #include #include using namespace std; const int M=100100; char s[M]; stack sta; int main() { int t; cin>>t; while(t--) { while(!sta.empty()) sta.pop(); int n;

2016-08-11 19:46:34 478

原创 hdu 2795 Billboard线段树运用(单点更新)

点击打开链接 #include #include #include using namespace std; const int M =201000; int dat[4*M]; int h,w,n; void Push_up(int rt) { dat[rt]=max(dat[rt*2],dat[rt*2+1]); } void build(int l,int r,int rt) {

2016-08-11 19:08:18 279

原创 hdu 5805 简单思维题

点击打开链接 #include #include #include #include #include #include using namespace std; const int M =101000; long n; long long a[M],f[M],g[M]; // f[i] 1~i中相邻差的最大值 g[i] i~n中相邻差最大值 int main()

2016-08-09 17:43:48 432

原创 hdu 5806尺取法运用

点击打开链接 #include #include #include using namespace std; const int M=201000; int n,m,k; int a[M]; long long ans; void solve() { int s=0,t=0,sum=0; while(1) { // as+1~at-1<=as~at-1<m wh

2016-08-09 13:43:32 547

原创 POJ 3276 反转(开关问题)

点击打开链接 #include #include #include using namespace std; const int M =5100; int dir[M];// dir[i] 0:F 1;B int n; int f[M]; // f[i] i~i+k-1的区间是否被翻转过 int calc(int k) //判断第i只cow的State 只要判断 j=i-k+1~

2016-08-06 22:22:02 427

原创 poj 3320 尺取法经典

点击打开链接 #include #include #include #include #include using namespace std; const int M=101000; int a[M],p,n; set all; int main() { int ans=M; cin>>p; for(int i=0;i<p;i++) { scanf("%d",&a[i

2016-08-05 14:58:54 381

原创 poj 3061 Subsequence尺取法

点击打开链接 #include #include using namespace std; const int M=101000; int a[M]; int main() { int t; cin>>t; while(t--) { long long sum=0,S; int ans=100100; int n; cin>>n>>S; for(int i=

2016-08-05 14:19:34 403

原创 poj 2456 最大化最小值(二分+贪心)

点击打开链接 #include #include using namespace std; const int M = 100100; long n,c; long a[M]; bool Check(long x) { int last=0; // 贪心 为了a[num]-a[last]>=x &&num<=n 成立 a[last]要尽量的小 for(int i=2;i<=

2016-08-04 14:34:31 656

原创 poj 1064 二分求最值(水)

点击打开链接 #include #include #include #include using namespace std; const int M = 101000; double a[M]; int n,k; bool Check(int x) //判断该解是否可行 { int num=0; for(int i=0;i<n;i++) { num+=a[i]/x; }

2016-08-04 13:58:28 313

原创 hdu 5773 字符串水题

统计字符串出现次数 点击打开链接 #include #include #include #include #include using namespace std; const int M=110; struct Node{ char s[M]; int win; }node[40]; void pre() { int i=0; node[i].win=1;

2016-08-02 17:18:22 369

原创 poj 1837 Balance 01背包(方法数)

点击打开链接 #include #include #include using namespace std; const int M =30; int c[M];// hook的位置 int w[M]; //砝码的重量 //放一个砝码对平衡对j所产生的影响为 臂长*重量 c[i]*w[i] int dp[M][16000]; //dp[i][j] 放前i个砝码时 平衡度为j

2016-08-01 15:22:32 337

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除