Highway Accepted : 122   Submit : 393 Time Limit : 4000 MS   Memory Limit : 65536 KB Highway In ICPCCamp there were n towns conveniently numbered with 1,2,…,n connected with (n−1) roads. The i -th road connecting towns ai and bi has length ci . It is…
Combine String #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> #include<queue> #include<vector> #include<map> using namespace std; typedef unsigned long long LL; #de…
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5705 题意:给你一个时间和一个角度,问你下一个时针和分针形成给出的角度是什么时候 题解:我们可以将这个问题看成追及问题,考虑时针:每小时30°,每分钟1/2°,每秒1/120°,考虑分针:没分钟6°,每秒1/10°,如果我把全部同时乘一个120,不就能避免精度造成的问题了吗!现在再来考虑时针和分针的位置情况:这里我们以分针按顺时针的方向到时针 1:当时针和分针的θ∠大于180*120时(1)当(36…
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5707 题意:给你三个字符串 a,b,c,问你 c能否拆成a,b,a,b串的每一个字符在c中不能变 题解:当时打再现赛的时候没根据题目的特殊性而在哪xjb搜,艹,设dp[i][j]表示为c的前i个字符可由a的前j个字符与b的前i-j个字符组合,dp[i][j]=0表示行不通,dp[i][j]=1,表示能行 ,然后判断是否存在dp[lenc][lena]这个状态,如果lenc!=lena+lenb,那么…
比赛链接: http://202.197.224.59/OnlineJudge2/index.php/Contest/problems/contest_id/36 题目来源: 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛 ×  Problem A A simple problem   (求N % 1 + N % 2 + ....+ N % N, 待补) ?  Problem B Path √  Problem C Range   (单调栈) √  Problem…
Deleting Edges Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 567    Accepted Submission(s): 210 Problem Description Little Q is crazy about graph theory, and now he creates a game about grap…
Happy Necklace Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1146    Accepted Submission(s): 491 Problem Description Little Q wants to buy a necklace for his girlfriend. Necklaces are single…
Graph Theory Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1796    Accepted Submission(s): 750 Problem Description Little Q loves playing with different kinds of graphs very much. One day he…
Building Shops Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 701 Accepted Submission(s): 265 Problem Description HDU’s n classrooms are on a line ,which can be considered as a number line. Eac…
/* HDU 6154 - CaoHaha's staff [ 构造,贪心 ] | 2017 中国大学生程序设计竞赛 - 网络选拔赛 题意: 整点图,每条线只能连每个方格的边或者对角线 问面积大于n的图形最少要几条线 分析: 可以发现面积相同的情况下,每条线都连对角的菱形是最优的 再考虑如何将 面积为x^2的菱形,每次扩展一条边, 按最优扩展为面积为(x+1)^2的菱形 然后就可以先二分,再判断了 */ #include <bits/stdc++.h> using namespace std;…