- 博客(23)
- 收藏
- 关注
原创 NYOJ 68 - 三点顺序
描述现在给你不共线的三个点A,B,C的坐标,它们一定能组成一个三角形,现在让你判断A,B,C是顺时针给出的还是逆时针给出的?如:图1:顺时针给出图2:逆时针给出 输入每行是一组测试数据,有6个整数x1,y1,x2,y2,x3,y3分别表示A,B,C三个点的横纵坐标。(坐标值都在0到10000之间)输入0 0 0 0 0 0表
2016-10-31 17:03:48 418
原创 NYOJ 99 - 单词拼接
描述给你一些单词,请你判断能否把它们首尾串起来串成一串。前一个单词的结尾应该与下一个单词的道字母相同。如alohadogarachnidgophertigerrat可以拼接成:aloha.arachnid.dog.gopher.rat.tiger输入第一行是一个整数N(0每组测试数据的第一行是一
2016-10-29 14:49:28 502
原创 HDU 5916 - Harmonic Value Description
Problem DescriptionThe harmonic value of the permutation p1,p2,⋯pn is∑i=1n−1gcd(pi.pi+1)Mr. Frog is wondering about the permutation whose harmonic value is the strictly k-th smallest among all
2016-10-29 13:05:40 338
原创 HDU 5726 - GCD
Problem DescriptionGive you a sequence of N(N≤100,000) integers : a1,...,an(0<ai≤1000,000,000). There are Q(Q≤100,000) queries. For each query l,r you have to calculate gcd(al,,al+1,...,ar) and coun
2016-10-28 17:41:22 304
原创 HDU 5723 - Abandoned country
Problem DescriptionAn abandoned country has n(n≤100000) villages which are numbered from 1 to n. Since abandoned for a long time, the roads need to be re-built. There are m(m≤1000000) roads to be
2016-10-26 19:12:50 382
转载 网络流算法基础
将每条有向边想象成传输物质的管道。每个管道都有一个固定的容量,可以看作是物质能流经该管道的最大速度(譬如可以想象为水流和河槽)。顶点是管道间的连接点,除了源点(S,Source)和汇点(T,Target)以外,物质只流经这些顶点。而不聚集在顶点中。 注:下文提到的数字,基本都可加单位 “单位流量”来理解。一、网络流基础 网络流中的最大流研究的问题是:在不违背
2016-10-26 19:02:45 773 2
原创 NYOJ 61 - 传纸条(一)
描述小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题。一次素质拓展活动中,班上同学安排做成一个m行n列的矩阵,而小渊和小轩被安排在矩阵对角线的两端,因此,他们就无法直接交谈了。幸运的是,他们可以通过传纸条来进行交流。纸条要经由许多同学传到对方手里,小渊坐在矩阵的左上角,坐标(1,1),小轩坐在矩阵的右下角,坐标(m,n)。从小渊传到小轩的纸条只可以向下或者向右传递,从小轩传给小渊
2016-10-25 14:45:28 564
原创 NYOJ 47 - 过河问题
描述在漆黑的夜里,N位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,N个人一共只带了一只手电筒,而桥窄得只够让两个人同时过。如果各自单独过桥的话,N人所需要的时间已知;而如果两人同时过桥,所需要的时间就是走得比较慢的那个人单独行动时所需的时间。问题是,如何设计一个方案,让这N人尽快过桥。输入第一行是一个整数T(1每
2016-10-22 15:48:20 457
原创 HDU 1427 - 速算24点
Problem Description速算24点相信绝大多数人都玩过。就是随机给你四张牌,包括A(1),2,3,4,5,6,7,8,9,10,J(11),Q(12),K(13)。要求只用'+','-','*','/'运算符以及括号改变运算顺序,使得最终运算结果为24(每个数必须且仅能用一次)。游戏很简单,但遇到无解的情况往往让人很郁闷。你的任务就是针对每一组随机产生的四张牌,判断是否有解。我们
2016-10-20 18:19:50 532
原创 NYOJ 30 - Gone Fishing
描述 John is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in the area (2 <= n <= 25) all reachable along a single, one-way road. John starts at lake 1, but h
2016-10-19 19:38:50 365
原创 NYOJ 10 - Skiing
描述 Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21
2016-10-19 18:13:40 414
原创 POJ 3041 - Asteroids
DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are conven
2016-10-18 14:56:26 266
原创 NYOJ 92 - 图像有用区域
描述“ACKing”同学以前做一个图像处理的项目时,遇到了一个问题,他需要摘取出图片中某个黑色线圏成的区域以内的图片,现在请你来帮助他完成第一步,把黑色线圏外的区域全部变为黑色。 图1 图2 已知黑
2016-10-15 22:54:11 376
原创 Codeforces 723D - Lakes in Berland
DescriptionThe map of Berland is a rectangle of the size n × m, which consists of cells of size1 × 1. Each cell is either land or water. The map is surrounded by the ocean.Lakes are the ma
2016-10-15 16:19:02 529
原创 Codeforce 723C - Polycarp at the Radio
DescriptionPolycarp is a music editor at the radio station. He received a playlist for tomorrow, that can be represented as a sequencea1, a2, ..., an, whereai is a band, which performs
2016-10-13 19:49:21 432
原创 Codeforce 723B - Text Document Analysis
DescriptionModern text editors usually show some information regarding the document being edited. For example, the number of words, the number of pages, or the number of characters.In this pro
2016-10-13 18:25:22 331
原创 Codeforce 723A - The New Year: Meeting Friends
DescriptionThere are three friend living on the straight line Ox in Lineland. The first friend lives at the pointx1, the second friend lives at the pointx2, and the third friend lives at the
2016-10-13 18:19:36 509
原创 HDU 1532 - Drainage Ditches
Problem DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long tim
2016-10-09 18:28:44 323
原创 HDU 5900 - QSC and Master
Problem DescriptionEvery school has some legends, Northeastern University is the same.Enter from the north gate of Northeastern University,You are facing the main building of Northeastern Univer
2016-10-08 18:54:34 307
原创 HDU 5898 - odd-even number
Problem DescriptionFor a number,if the length of continuous odd digits is even and the length of continuous even digits is odd,we call it odd-even number.Now we want to know the amount of odd-even n
2016-10-04 18:04:54 353
原创 HDU 5901 - Count Primes
Problem DescriptionEasy question! Calculate how many primes between [1...n]!InputEach line contain one integer n(1 OutputFor each case, output the number of primes in interval [1...n]
2016-10-04 10:26:37 430
原创 HDU 5884 - Sort
Problem DescriptionRecently, Bob has just learnt a naive sorting algorithm: merge sort. Now, Bob receives a task from Alice.Alice will give Bob N sorted sequences, and the i-th sequence includes a
2016-10-03 14:26:34 322
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人