- 博客(62)
- 资源 (3)
- 收藏
- 关注
原创 zzulioj 1730: 通信基站 【全排列 + DFS】
题目:链接思路:暴力,方法有很多。。。说下我的写法——首先N最大为8,那么我们直接枚举在那些点建基电站。这里直接一个全排列就可以了,1代表建,0代表不建。我们把0的点存为a[],1的点存为b[],然后就是从b[]里面选若干个点引半径做圆 来覆盖a[]里面的所有点,只需要求出最小半径和即可。求最小半径和直接DFS就好了,在DFS的过程中维护b[]中每个点所引最大半径,最后求和。
2016-02-29 21:05:33 595
原创 hihocoder week 86 Spring Outing【思维】
P1 : Spring OutingTime Limit:20000msCase Time Limit:1000msMemory Limit:256MBDescriptionYou class are planning for a spring outing. N people are voting for a destination o
2016-02-29 21:04:00 644
原创 Codeforces 633D Fibonacci-ish 【暴力递归】
D. Fibonacci-ishtime limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYash has recently learnt about the Fibonac
2016-02-29 21:03:42 800
原创 Codeforces 633C Spy Syndrome 2 【字典树 + DFS】
C. Spy Syndrome 2time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter observing the results of Spy Syndro
2016-02-29 21:03:28 1028
原创 Codeforces 633B A Trivial Problem 【数论】
B. A Trivial Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMr. Santa asks all the great programme
2016-02-29 21:03:15 939
原创 Codeforces 633A Ebony and Ivory 【水题】
A. Ebony and Ivorytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDante is engaged in a fight with "The Sa
2016-02-29 21:02:44 766
原创 NUBT 1222 English Game 【字典树 + dp】
大一时比赛的剩题,今天不经意发现了。题目链接:点我题意:给定目标串str和n个短串以及每个短串的权值,现在让你用这n个短串连接成str串。若可以得到目标串,输出最大的权值和,反之输出-1。要求每个短串只能用一次。思路:建立一棵trie,标记短串末尾。设置dp[i]为 构成(str[i]-末尾)子串的最大权值和。每次可以从str[i]字符沿着trie向下走,走到字符s
2016-02-28 18:41:48 912
原创 。。。。。。
今天不管做什么题,都莫名SB。hihocoder还有几道待补坑的题目。。。A题链接:AAC代码:#include #include #include #include #include using namespace std;int a[3][2];bool judge(int x, int y, int z){ if(a[x][0] == a[y][0]) { if(a[
2016-02-28 00:03:32 409
原创 Codeforces 629D Babaei and Birthday Cake 【线段树优化dp】
D. Babaei and Birthday Caketime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs you know, every birthday par
2016-02-27 23:42:05 934
原创 Codeforces 629C Famil Door and Brackets 【dp】
C. Famil Door and Bracketstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs Famil Door’s birthday is comi
2016-02-27 23:40:01 1091
原创 Codeforces 629B Far Relative’s Problem 【水题】
B. Far Relative’s Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFamil Door wants to celebrate his
2016-02-27 23:39:33 491
原创 Coderforces 629A Far Relative’s Birthday Cake 【水题】
A. Far Relative’s Birthday Caketime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDoor's family is going celeb
2016-02-27 23:38:55 432
原创 hdoj 5634 Rikka with Phi 【线段树 + 欧拉】
Rikka with PhiTime Limit: 16000/8000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 207 Accepted Submission(s): 64Problem DescriptionRikka and Y
2016-02-27 23:38:30 798
原创 hdoj 5631 Rikka with Graph 【并查集】
Rikka with GraphTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 622 Accepted Submission(s): 283Problem DescriptionAs we know,
2016-02-27 23:38:10 436
原创 hdoj 5630 Rikka with Chess 【水题】
Rikka with ChessTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 280 Accepted Submission(s): 240Problem DescriptionYuta gives
2016-02-27 23:36:57 419
原创 Codeforces 628D Magic Numbers 【数位dp】
题目链接:点我定义 d-数:数d有且只在偶数位上,奇数位不能出现d。题意:给定一个区间[L, R],问区间里面可以被m整除的d-数个数。思路:数位dp,dp[i][j]表示处理到第i位%m == j的方案数。记忆化一下就好了。10^2000太大了,端点需要特判一下。AC代码:#include #include #include #inc
2016-02-20 18:21:15 1074
原创 Codeforces 628C Bear and String Distance 【构造】
题目链接:点我题意:定义dist(字母1, 字母2) = 两字母ascll之差。给定一个串a和一个值k,找到另一个串b(长度相等)使得两串各个位置的dist()之和 == k。思路:每次尽可能大的去补,补得范围在min(k, 当前字母可以补的最大范围)。最后判断k 是否为 0。sort一下并没有什么用。。。AC代码:#include #includ
2016-02-20 18:20:50 541
原创 Codeforces 628B New Skateboard【数学】
题目链接:点我题意:给定一个数字串,问可以被4整除的子串有多少个?可以有前缀0。——能被4整除的数:末尾的两位数必定是4的倍数。暴力扫一遍就好了。AC代码:#include #include #include #include #include #include #define CLR(a, b) memset(a, (b), sizeof(a))#d
2016-02-20 18:20:29 437
原创 Codeforces 628A Tennis Tournament 【水题】
题目链接:点我题意:有n个参赛队员,每次选择k(kAC代码:#include #include #include #include #include #include #define CLR(a, b) memset(a, (b), sizeof(a))#define PI acos(-1.0)using namespace std;typed
2016-02-20 18:20:00 459
原创 hihoCoder week 85 Numeric Keypad 【DFS】
P1 : Numeric KeypadTime Limit:10000msCase Time Limit:1000msMemory Limit:256MBDescriptionThe numberic keypad on your mobile phone looks like below:1 2 34 5 67 8 9 0
2016-02-20 18:19:28 484
原创 Experimental Educational Round: VolBIT Formulas Blitz
表示某些题目的题意好扯,好多经典老题。。。A链接:B链接:C链接:D链接:E链接:F链接:G链接:H链接:I链接:J链接:K链接:L链接:M链接:N链接:O链接:P链接:Q链接:R链接:
2016-02-19 18:35:43 345
原创 Codeforces 626E Simple Skewness 【二分】
E. Simple Skewnesstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDefine the simple skewness of a collecti
2016-02-14 16:54:52 1204 3
原创 Codeforces 626D Jerry's Protest 【概率】
D. Jerry's Protesttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndrew and Jerry are playing a game with
2016-02-14 16:54:29 615
原创 Codeforces 626C Block Towers 【二分】
C. Block Towerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputStudents in a class are making towers of bl
2016-02-14 16:54:15 733
原创 Codeforces 626B Cards 【BFS or 讨论】
B. Cardstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputCatherine has a deck of n cards, each of which is
2016-02-14 16:54:01 527
原创 Codeforces 626A Robot Sequence 【水题】
A. Robot Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputCalvin the robot lies in an infinite rect
2016-02-14 16:53:46 937
原创 hdoj 5627 Clarke and MST 【最大and生成树】
Clarke and MSTTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 165 Accepted Submission(s): 85Problem DescriptionClarke is a pa
2016-02-14 16:53:27 539
原创 hdoj 5626 Clarke and points 【思维】
Clarke and pointsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 106 Accepted Submission(s): 80Problem DescriptionClarke is a
2016-02-14 16:53:10 453
原创 hdoj 4666 Hyperspace 【最远曼哈顿距离】
HyperspaceTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1219 Accepted Submission(s): 580Problem DescriptionThe great Mr.S
2016-02-14 16:52:53 525
原创 poj 2926 Requirements 【5维点集最远曼哈顿距离】
RequirementsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 4090 Accepted: 1411DescriptionAn undergraduate student, realizing that he needs to do re
2016-02-14 16:52:35 670
原创 Codeforces 622D Optimal Number Permutation 【贪心】
D. Optimal Number Permutationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have array a that contains
2016-02-13 18:21:04 626
原创 Codeforces 622C Not Equal on a Segment 【线段树 or dp】
C. Not Equal on a Segmenttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given array a with n integ
2016-02-13 18:20:43 589
原创 Codeforces 622B The Time 【水题】
B. The Timetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given the current time in 24-hour format
2016-02-13 18:20:15 374
原创 Codeforces 622A Infinite Sequence 【数学】
A. Infinite Sequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputConsider the infinite sequence of integ
2016-02-13 18:20:02 492
原创 Codeforces 624B Making a String 【水题】
B. Making a Stringtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an alphabet consisting of n
2016-02-13 18:19:41 504
原创 Codeforces 624A Save Luke 【数学】
A. Save Luketime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLuke Skywalker got locked up in a rubbish shred
2016-02-13 18:19:16 656
原创 hihoCoder week 84 P1 : Lucky Substrings 【dp】
P1 : Lucky SubstringsTime Limit:10000msCase Time Limit:1000msMemory Limit:256MBDescriptionA string s is LUCKY if and only if the number of different characters in s is a
2016-02-10 18:57:49 488
原创 hiho #1138 : Islands Travel 【最短路】
#1138 : Islands TravelTime Limit:10000msCase Time Limit:1000msMemory Limit:256MBDescriptionThere are N islands on a planet whose coordinates are (X1, Y1), (X2, Y2), (X3
2016-02-10 18:57:26 1197 1
原创 hdoj 5623 KK's Number 【dp】
KK's NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 146 Accepted Submission(s): 88Problem DescriptionOur lovely KK has
2016-02-10 18:57:07 408
原创 hdoj 5621 KK's Point 【数学】
KK's PointTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 478 Accepted Submission(s): 164Problem DescriptionOur lovely KK has
2016-02-10 18:56:47 462
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人