G - Coding Contest  HDU - 5988  A coding contest will be held in this university, in a huge playground. The whole playground would be divided into N blocks, and there would be M directed paths linking these blocks. The i-th path goes from the uiui-th block to the vivi-th block. Your task is to solve the lunch issue. According to the arrangement, there are sisi competitors in the i-th block. Limited to the size of table, bibi bags of 继续阅读 >>

楚东方 17/11/28 23:17:48
题目链接 The story happened long long ago. One day, Cao Cao made a special order called “Chicken Rib” to his army. No one got his point and all became very panic. However, Cao Cao himself felt very proud of his interesting idea and enjoyed it. Xiu Yang, one of the cleverest counselors of Cao Cao, understood the command Rather than keep it to himself, he told the point to the whole army. Cao Cao got very angry at his cleverness and would like to punish Xiu Yang. But how can you pun 继续阅读 >>

楚东方 17/11/26 21:23:30
一些常见的状态码为: 200 - 服务器成功返回网页 404 - 请求的网页不存在 503 - 服务不可用 详细分解: 1xx(临时响应) 表示临时响应并需要请求者继续执行操作的状态代码。 代码 说明 100 (继续) 请求者应当继续提出请求。服务器返回此代码表示已收到请求的第一部分,正在等待其余部分。  101 (切换协议) 请求者已要求服务器切换协议,服务器已确认并准备切换。 2xx (成功) 表示成功处理了请求的状态代码。 代码 说明 200 (成功) 服务器已成功处理了请求。通常,这表示服务器提供了请求的网页。 201 (已创建) 请求成功并且服务器创建了新的资源。 202 (已接受) 服务器已接受请求,但尚未处理。 203 (非授权信息) 服务器已成功处理了请求,但返回的信息可能来自另一来源。 204 (无内容) 服务器成功处理了请求,但没有返回任何内容。 205 (重置内容) 服务器成功处理了请求,但没有返回任何内容。 206 (部分内容) 服务器成功处理了部分 GET 请求。 3xx (重定向) 表示要完成请求,需要进一 继续阅读 >>

楚东方 17/11/26 20:47:01
Xor Sum Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 3313    Accepted Submission(s): 1435 Problem Description Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Prometheus 为了让 Zeus 看到人类的伟大,随即同意 Zeus 可以向人类求助。你能证明人类的智慧么?   Input 输入包含若干组测试数据,每组测试数据包含若干行。 输入的第一行是一个整数T(T < 继续阅读 >>

楚东方 17/11/25 22:26:18
1954: Pku3764 The xor-longest Path Time Limit: 1 Sec  Memory Limit: 64 MB Submit: 897  Solved: 406 [Submit][Status][Discuss] Description  给定一棵n个点的带权树,求树上最长的异或和路径 Input The input contains several test cases. The first line of each test case contains an integer n(1<=n<=100000), The following n-1 lines each contains three integers u(0 <= u < n),v(0 <= v < n),w(0 <= w < 2^31), which means there is an edge between 继续阅读 >>

楚东方 17/11/25 22:03:21
Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20; Each test case consists of one string, whose length is <= 1000 Output For each test case output one number saying the number of distinct substrings. Example Sample Input: 2 CCCCC ABABA Sample Output: 5 9 Explanation for the testcase with string ABABA:  len=1 : A,B len=2 : AB,BA len=3 : ABA,BAB len=4 : ABAB,BABA len=5 : ABABA Thus, total number of distin 继续阅读 >>

楚东方 17/11/24 08:54:38
Milk Patterns Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 16696   Accepted: 7371 Case Time Limit: 2000MS Description Farmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he can't predict the quality of milk from one day to the next, there are some regular patterns in the daily milk quality. To perform a rigorous study, he h 继续阅读 >>

楚东方 17/11/24 08:43:47
Musical Theme Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 31535   Accepted: 10511 Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this representation of melodies ignores the notion of musical timing; but, this programming task is about notes and not timings.  Many com 继续阅读 >>

楚东方 17/11/23 11:46:33
1672: [Usaco2005 Dec]Cleaning Shifts 清理牛棚 Time Limit: 5 Sec  Memory Limit: 64 MB Submit: 975  Solved: 419 [Submit][Status][Discuss] Description Farmer John's cows, pampered since birth, have reached new heights of fastidiousness. They now require their barn to be immaculate. Farmer John, the most obliging of farmers, has no choice but hire some of the cows to clean the barn. Farmer John has N (1 <= N <= 10,000) cows who are willing 继续阅读 >>

楚东方 17/10/28 21:52:12
1638: [Usaco2007 Mar]Cow Traffic 奶牛交通 Time Limit: 5 Sec  Memory Limit: 64 MB Submit: 1008  Solved: 389 [Submit][Status][Discuss] Description 农场中,由于奶牛数量的迅速增长,通往奶牛宿舍的道路也出现了严重的交通拥堵问题.FJ打算找出最忙碌的道路来重点整治. 这个牧区包括一个由M (1 ≤ M ≤ 50,000)条单行道路(有向)组成的网络,以及 N (1 ≤ N ≤ 5,000)个交叉路口(编号为1..N),每一条道路连接两个不同的交叉路口.奶牛宿舍位于第N个路口.每一条道路都由编号较小的路口通向编号较大的路口.这样就可以避免网络中出现环.显而易见,所有道路都通向奶牛宿舍.而两个交叉路口可能由不止一条边连接. 在准备睡觉的时候,所有奶牛都从他们各自所在的交叉路口走向奶牛宿舍,奶牛只会在入度为0的路口,且所有入度为0的路口都会有奶牛. 帮 继续阅读 >>

楚东方 17/10/27 22:43:47