寻找大富翁 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5679 Accepted Submission(s): 2194 Problem Description 浙江桐乡乌镇共有n个人,请找出该镇上的前m个大富翁. Input 输入包含多组测试用例. 每个用例首先包含2个整数n(0<n<=100000)和m(0<
As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are
This time, you are supposed to find A+B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K N1 aN1 N2 aN2 ... NK
给定一个常数 K 以及一个单链表 L,请编写程序将 L 中每 K 个结点反转.例如:给定 L 为 1→2→3→4→5→6,K 为 3,则输出应该为 3→2→1→6→5→4:如果 K 为 4,则输出应该为 4→3→2→1→5→6,即最后不到 K 个元素不反转. 输入格式: 每个输入包含 1 个测试用例.每个测试用例第 1 行给出第 1 个结点的地址.结点总个数正整数 N (≤105).以及正整数 K (≤N),即要求反转的子链结点的个数.结点的地址是 5 位非负整数,NULL 地址用 −1 表示.