![](https://img-blog.csdnimg.cn/20190918140129601.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
ACM_C语言
大学期间ACM比赛
qq2547670355
这个作者很懒,什么都没留下…
展开
-
HDU---1745
Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和原创 2016-07-23 15:41:01 · 148 阅读 · 0 评论 -
POJ--3264
DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows原创 2016-07-23 15:40:34 · 115 阅读 · 0 评论 -
hdu---1166
DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报原创 2016-07-23 15:40:01 · 178 阅读 · 0 评论 -
POJ---3468
Description给出了一个序列,你需要处理如下两种询问。"C a b c"表示给[a, b]区间中的值全部增加c (-10000 ≤ c ≤ 10000)。"Q a b" 询问[a, b]区间中所有值的和。Input第一行包含两个整数N, Q。1 ≤ N,Q ≤ 100000.第二行包含n个整数,表示初始的序列A (-1000000000 ≤ Ai ≤ 1000000000)。原创 2016-07-23 15:38:20 · 225 阅读 · 0 评论 -
HDU----1689
DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length.原创 2016-07-23 15:37:15 · 133 阅读 · 0 评论 -
HDU---1689
DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same lengt原创 2016-07-23 15:34:41 · 122 阅读 · 0 评论 -
棋盘问题
#include#include#include#include#includeusing namespace std;int n, m, ans, vis[10];char ch[10][10];void dfs(int cur, int num){ if(num==m) { ans++; return原创 2016-07-23 15:44:25 · 141 阅读 · 0 评论 -
poj---3126
DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. —原创 2016-07-23 15:32:04 · 145 阅读 · 0 评论 -
POJ---1062昂贵的聘礼
Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币原创 2016-08-01 19:33:33 · 142 阅读 · 0 评论 -
Aizu 0189
Description来春卒業するAさんは,就職を機に引越しをすることにしました。就職する会社は,オフィスがい くつかの町にあって、日によって出勤するオフィスが違います。そこでAさんは,どこのオフィスに 行くにも時間の短い町に住もうと考えました。そこであなたは、Aさんを助けるため、住むのに一番便利な町を探すことになりました。町には0から始まる番号が振られており、町と町の間には道原创 2016-07-31 12:50:12 · 168 阅读 · 0 评论 -
poj ---2253
DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full原创 2016-07-27 14:05:40 · 124 阅读 · 0 评论 -
HDU----1875
Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了原创 2016-07-24 16:40:53 · 489 阅读 · 0 评论 -
poj---1511
DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique原创 2016-07-24 16:25:28 · 136 阅读 · 0 评论 -
poj----2253
DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full原创 2016-07-23 15:30:40 · 223 阅读 · 0 评论 -
poj----3259
DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination原创 2016-07-23 15:30:11 · 119 阅读 · 0 评论 -
poj---3660
DescriptionN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skil原创 2016-07-23 15:29:40 · 248 阅读 · 0 评论 -
poj---1502
DescriptionBIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKe原创 2016-07-23 15:29:10 · 276 阅读 · 0 评论 -
POJ----2502
DescriptionYou have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Becaus原创 2016-07-23 15:28:36 · 166 阅读 · 0 评论 -
poj---1847
DescriptionTram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of t原创 2016-07-23 15:27:55 · 172 阅读 · 0 评论 -
POJ1287——————networking
DescriptionYou are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may con原创 2016-08-03 08:54:11 · 294 阅读 · 0 评论 -
POJ 2377
DescriptionBessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has already done some surveying, and found原创 2016-07-31 12:50:59 · 154 阅读 · 0 评论 -
poj-----2349
Description国防部(DND)要用无线网络连接北部几个哨所。两种不同的通信技术被用于建立网络:每一个哨所有一个无线电收发器,一些哨所将有一个卫星频道。任何两个有卫星信道的哨所可以通过卫星进行通信,而不管他们的位置。同时,当两个哨所之间的距离不超过D时可以通过无线电通讯,D取决于对收发器的功率。功率越大,D也越大,但成本更高。出于采购和维修的方便,所有哨所的收发器必须是相同的;那原创 2016-07-25 20:32:53 · 155 阅读 · 0 评论 -
poj---2349
Description国防部(DND)要用无线网络连接北部几个哨所。两种不同的通信技术被用于建立网络:每一个哨所有一个无线电收发器,一些哨所将有一个卫星频道。任何两个有卫星信道的哨所可以通过卫星进行通信,而不管他们的位置。同时,当两个哨所之间的距离不超过D时可以通过无线电通讯,D取决于对收发器的功率。功率越大,D也越大,但成本更高。出于采购和维修的方便,所有哨所的收发器必须是相同的;那原创 2016-07-25 17:10:32 · 281 阅读 · 0 评论 -
pog---1861- Network
DescriptionAndrew is working as system administrator and is planning to establish a new network in his company. There will be N hubs in the company, they can be connected to each other using cab原创 2016-05-30 15:04:04 · 160 阅读 · 0 评论 -
蓝桥杯四平方和
题意:这一道题就是利用暴力四重for'循环解决,当然也可以用dfs依次遍历#includeint main(){int i, j, k, l, n, a, b, c, d;scanf("%d",&n);for(i=0;;++i){a=i*i;for(j=i;a+j*j{b=a+j*j;for(k=j;b+k*k{c=b+k*k原创 2017-04-07 14:29:12 · 230 阅读 · 0 评论 -
LightOJ 1030
DescriptionYou are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold.Initially you are in position 1. Now each turn you th原创 2016-08-19 14:58:41 · 250 阅读 · 0 评论 -
序列中增序列的最大个数
#include#include#include#includeusing namespace std;#include#define N 10009int a[N];int fun(int a[], int len){ int Max=0; int temp=1; int key; for(int i=0;i原创 2016-08-18 19:31:46 · 217 阅读 · 0 评论 -
CodeForces 702A
DescriptionYou are given array consisting of n integers. Your task is to find the maximum length of an increasing subarray of the given array.A subarray is the sequence of consecutive elements o原创 2016-08-18 19:30:05 · 213 阅读 · 0 评论 -
POJ----3061
DescriptionA sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal le原创 2016-08-18 19:20:13 · 271 阅读 · 0 评论 -
关于 栈和堆
DescriptionACboy was kidnapped!! he miss his mother very much and is very scare now.You can't image how dark the room he was put into is, so poor :(. As a smart ACMer, you want to get ACboy ou原创 2016-08-18 14:05:40 · 152 阅读 · 0 评论 -
LightOJ 1104
DescriptionSometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is原创 2016-08-14 10:51:44 · 223 阅读 · 0 评论 -
UVA____10200
这个就是一个简单的素数判断,然后就是求a, b之间素数存在的概率不知道为什么就是最后概率后面要+1e-8可能即使double精确度吧#include#include#include#include#includeusing namespace std;#define N 11000int f[N];int q(long long m){ i原创 2016-08-14 10:32:40 · 142 阅读 · 0 评论 -
zznuli--1909
Description小火山和他的朋友岩浆, 分别打算去买商店买一些东西。小火山的起始位置为(X1, Y1),终止位置为(X2, Y2), 速度为U;岩浆的起始位置为(X3, Y3), 终止位置为(X4, Y4), 速度为V, 双方一块出发, 到达终止位置后, 都会在终止位置停留。 现在小火山想知道他和岩浆在此过程中的最小距离。Input输入第一行是一个整数原创 2016-08-11 10:17:15 · 156 阅读 · 0 评论 -
CodeForces 500A
DescriptionNew Year is coming in Line World! In this world, there are n cells numbered by integers from 1 to n, as a 1 × n board. People live in cells. However, it was hard to move between disti原创 2016-08-05 21:07:34 · 194 阅读 · 0 评论 -
简单DP
DescriptionJesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when could he go back h原创 2016-08-04 20:01:05 · 154 阅读 · 0 评论 -
调和级数求和
DescriptionIn mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers:In this problem, you are given n, you have to find Hn.InputInput s原创 2016-08-04 19:59:15 · 1313 阅读 · 0 评论 -
简单
DescriptionSVM(Support Vector Machine)is an important classification tool, which has a wide range of applications in cluster analysis, community division and so on. SVM The kernel functions used i原创 2016-08-04 16:09:08 · 153 阅读 · 0 评论 -
斐波那契数列,大数据
DescriptionYou will be given a string which only contains ‘1’; You can merge two adjacent ‘1’ to be ‘2’, or leave the ‘1’ there. Surly, you may get many different results. For example, given 1111原创 2016-08-04 13:44:47 · 407 阅读 · 0 评论 -
河南多校大一训练赛
DescriptionYour karate club challenged another karate club in your town. Each club enters N players into the match, and each player plays one game against a player from the other team. Each game t原创 2016-08-03 18:45:54 · 301 阅读 · 0 评论 -
LightOJ 1198
DescriptionYour karate club challenged another karate club in your town. Each club enters N players into the match, and each player plays one game against a player from the other team. Each game t原创 2016-07-31 12:44:49 · 146 阅读 · 0 评论