上一页 1 2 3 4 5 6 7 ··· 15 下一页

2019年10月9日

TZOJ 4267 An Easy Puz(深搜)

摘要: 描述 Wddpdh find an interesting mini-game in the BBS of WHU, called “An easy PUZ”. It’s a 6 * 6 chess board and each cell has a number in the range of 0 阅读全文

posted @ 2019-10-09 16:27 大桃桃 阅读(166) 评论(0) 推荐(0) 编辑

2019年10月8日

TZOJ 4021 Ugly Problem(线段树区间子段最大)

摘要: 描述 给定一个序列A[0],A[1],…A[N-1],要求找到p0,p1,p2,p3使得A[p0]+A[p0+1]+…+A[p1] + A[p2]+A[p2+1]+…+A[p3]最大(0<=p0<=p1<p2<=p3<N)。你只需要求出这个最大值就可以。 给定一个序列A[0],A[1],…A[N-1 阅读全文

posted @ 2019-10-08 20:09 大桃桃 阅读(116) 评论(0) 推荐(0) 编辑

2019年10月6日

TZOJ 4651 zry和他的的灯泡们(lca)

摘要: 描述 zry有一个收集灯泡的习惯,他把灯泡的阴极都共地,阳极连成一颗树,这样的话,他只要在任意一个灯泡的阳极加上合适的电压,所有灯泡都能亮起来。不幸的是,有一对灯泡之间的阳极连线断掉了,这样的话,这颗灯泡树就还有一部分能亮,一部分不能亮了。zry想知道如果他在任意一个灯泡的阳极上加电压,这一对灯泡的 阅读全文

posted @ 2019-10-06 22:55 大桃桃 阅读(136) 评论(0) 推荐(0) 编辑

2019年10月5日

TZOJ 3042 切蛋糕(并查集)

摘要: 描述 KK是个心灵手巧的好姑娘,她做了一个大蛋糕请她的好朋友们来品尝。这个蛋糕分成n×n个正方形小格,每个小格包含一块水果。KK要把蛋糕切成若干块,显然她不会破坏任意一个小格。无聊的某同学在她切蛋糕时不停地问她同一种问题:某两个小格是否还在同一块蛋糕里?例如下图中,KK从(1,1)切到(4,1),又 阅读全文

posted @ 2019-10-05 23:19 大桃桃 阅读(175) 评论(0) 推荐(0) 编辑

2019年9月18日

TZOJ 2478 How many 0's?(数位DP)

摘要: 描述 A Benedict monk No.16 writes down the decimal representations of all natural numbers between and including m and n, m ≤ n. How many 0's will he wri 阅读全文

posted @ 2019-09-18 17:57 大桃桃 阅读(151) 评论(0) 推荐(0) 编辑

2019年8月27日

TZOJ 5986 玄武密码(AC自动机)

摘要: 描述 在美丽的玄武湖畔,鸡鸣寺边,鸡笼山前,有一块富饶而秀美的土地,人们唤作进香河。相传一日,一缕紫气从天而至,只一瞬间便消失在了进香河中。老人们说,这是玄武神灵将天书藏匿在此。 很多年后,人们终于在进香河地区发现了带有玄武密码的文字。更加神奇的是,这份带有玄武密码的文字,与玄武湖南岸台城的结构有微 阅读全文

posted @ 2019-08-27 23:39 大桃桃 阅读(212) 评论(0) 推荐(0) 编辑

2019年8月4日

计蒜客 Flashing Fluorescents(状压DP)

摘要: You have nn lights, each with its own button, in a line. Pressing a light’s button will toggle that light’s state; if the light is on, it will turn of 阅读全文

posted @ 2019-08-04 23:29 大桃桃 阅读(313) 评论(0) 推荐(0) 编辑

计蒜客 Red Black Tree(树形DP)

摘要: You are given a rooted tree with n nodes. The nodes are numbered 1..n. The root is node 1, and m of the nodes are colored red, the rest are black. You 阅读全文

posted @ 2019-08-04 22:07 大桃桃 阅读(177) 评论(0) 推荐(0) 编辑

计蒜客 Zoning Houses(线段树区间最大次大)

摘要: Given a registry of all houses in your state or province, you would like to know the minimum size of an axis-aligned square zone such that every house 阅读全文

posted @ 2019-08-04 21:45 大桃桃 阅读(218) 评论(0) 推荐(0) 编辑

计蒜客 Prefix Free Code(字典树+树状数组)

摘要: Consider n initial strings of lower case letters, where no initial string is a prefix of any other initial string. Now, consider choosing k of the str 阅读全文

posted @ 2019-08-04 21:17 大桃桃 阅读(151) 评论(0) 推荐(0) 编辑

2019年5月26日

ACM-ICPC 2019 西安邀请赛 D.Miku and Generals(二分图+可行性背包)

摘要: “Miku is matchless in the world!” As everyone knows, Nakano Miku is interested in Japanese generals, so Fuutaro always plays a kind of card game about 阅读全文

posted @ 2019-05-26 21:17 大桃桃 阅读(403) 评论(0) 推荐(0) 编辑

集训队日常训练20180525-DIV2

摘要: A.2295 求有多少素数对和等于n。 暴力。 #include <bits/stdc++.h> using namespace std; int ss(int n) { int i=2,a=sqrt(n); for(;i<=a;i++) if(n%i==0) return 0; return 1; 阅读全文

posted @ 2019-05-26 16:34 大桃桃 阅读(197) 评论(0) 推荐(0) 编辑

集训队日常训练20180525-DIV1

摘要: A.2805 N*M的图,每次浇水(X1,Y1)-(X2,Y2)围成的矩形,问最后有多少点被浇水了。 暴力。 #include<bits/stdc++.h> using namespace std; bool g[245][245]; int main() { int X,Y,I; cin>>X>> 阅读全文

posted @ 2019-05-26 10:57 大桃桃 阅读(391) 评论(0) 推荐(0) 编辑

2019年5月18日

集训队日常训练20180518-DIV2

摘要: A.3232 n个物品,换取要花积分,问刚好花完积分能换最大多少价值的物品。 多重背包。 #include <bits/stdc++.h> using namespace std; int t[1005]; int main() { int m,n,i,a,b,c,T,j,k; scanf("%d" 阅读全文

posted @ 2019-05-18 20:25 大桃桃 阅读(286) 评论(0) 推荐(0) 编辑

2019年5月17日

集训队日常训练20180518-DIV1

摘要: A.3583 n根木棍是否能分成相等两堆。 背包dp,首先求和sum,如果为偶数就说明不行,否则考虑做一个sum/2大小的背包。 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { 6 int n,w[105]; 7 阅读全文

posted @ 2019-05-17 23:38 大桃桃 阅读(391) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 15 下一页

导航