随笔分类 - ACM
摘要:#include #include #include #include #define MAX 100010using namespace std;int n,k,qr,ql,v,p;int father[MAX*4];char str[MAX * 4];int query(int o,int l,int r){ int m = (l+r) / 2; int ans = 1; if(ql 0) father[o] = 1; else if(t==0) father[o] = 0; else if(t 0)...
阅读全文
摘要:Heidi has a discrete analog clock in the shape of a circle, as the one in the gure. Two hands rotatearound the center of the circle, indicating hours and minutes. The clock has 60 marks placed aroundits perimeter, with the distance between consecutive marks being constant.The minute hand moves from.
阅读全文
摘要:#include#includeusing namespace std;#define VEX 5//定义结点的个数#define maxpoint 100double graph[][maxpoint]={ { 0 , 10 , -1 , 30 , 100 }, { -1 , 0 , 50 , -1 , -1 } , { -1 , -1 , 0 , -1 , 10 } , { -1 , -1 , 20 , 0 , 60 } , { -1 , -1 , -1 , -1 , 0 }}; //邻接矩阵int i,j;int main(){ int R[maxp...
阅读全文
摘要:#include #include #include #define MAXN 101using namespace std;int main(){ char c; double t,d,h; while(1) { t = MAXN; d = MAXN; h = MAXN; int cnt = 2; while(cnt--) { scanf("%c",&c); if(c=='E') return 0; ...
阅读全文
摘要:好久没写了,感觉只要一段时间不写代码什么的就手生了,所以还是要多多练习嘛国庆出去玩了4天,上了3天课,翘了7天的集训,然后被教练骂了。。。还不让我去参加区域赛了,哭瞎~好吧,开始做题了,目标3题
阅读全文
摘要:11点40左右感到新校,我们到的时候才几个人啊.期间随便看了看网站,也就是苹果的发布会,等到12点开始做题了,不过队友还没有来啦,首先A了一道水水水题A Computer Graphics Problemhttp://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1001&cid=483按格式输出不同的符号而已直接贴代码了#include #include using namespace std;int main(){ int n,x; scanf("%d",&n); for(int i=1;i0;j
阅读全文
摘要:A#include #include #include #include #include #includeusing namespace std;int t,n,m,r,s,q,p,c;double score[505];int rList[505],sList[505],jamList[1005];class Competition{public: int rank; string team;};Competition com[505];class People{ public: string team; string name; char sex; ...
阅读全文
摘要:Jungle RoadsTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 1301DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes r
阅读全文
摘要:Connect the CitiesTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 3371DescriptionIn 2100, since the sea level rise, most of the cities disappear. Though some survived cities are still connected with others, but most of them become disconnected. The gover
阅读全文
摘要:畅通工程再续Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 1875Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了
阅读全文
摘要:畅通工程Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 1863Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。Input测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( #include using namesp
阅读全文
摘要:还是畅通工程Time Limit:2000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 1233Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( #include #include #define MA
阅读全文
摘要:A -Constructing RoadsTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 1102DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B a
阅读全文
摘要:A - BracketsTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 2955DescriptionWe give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence,if s is a regular brackets sequence, then (s) an
阅读全文
摘要:Halloween treatsTime Limit: 2000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64u[Submit] [Go Back] [Status] DescriptionEvery year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets on that day, no matter how many children call o
阅读全文
摘要:Find a multipleTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64u[Submit] [Go Back] [Status] DescriptionThe input contains N natural (i.e. positive integer) numbers ( N #include const int N = 10001;int a[N],sum[N],visit[N] ;int n;void print(int i,int j){ printf("%d\n&qu
阅读全文
摘要:CodeTime Limit:1000MSMemory Limit:30000KB64bit IO Format:%I64d & %I64u[Submit] [Go Back] [Status]DescriptionTransmitting and memorizing information is a task that requires different coding systems for the best use of the available space. A well known system is that one where a number is associat
阅读全文
摘要:不容易系列之一Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64u[Submit] [Go Back] [Status]Description大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了!做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有一个神奇的女生,在英语考试的时候,竟然把40个单项选择题全部做错了!大家都学过概率论,应该知道出现这种情况的概率,
阅读全文
摘要:E -Little RooksTime Limit:500MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeSGU 222DescriptionInspired by a "Little Bishops" problem, Petya now wants to solve problem for rooks.A rook is a piece used in the game of chess which is played on a board of square grid
阅读全文
摘要:B -Piggy-BankTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is
阅读全文

浙公网安备 33010602011771号