ACM
lian_li
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Buildings
Sample Input22 21 10 03 31 0 10 0 11 1 0Sample Output25import java.io.*;import java.util.*;public class PracticeIV {public static void main(String[] args) {Scanner原创 2015-04-22 10:30:03 · 443 阅读 · 0 评论 -
Rightmost Digit
Sample Input234Sample Output76HintIn the first case, 3 * 3 * 3 = 27, so the rightmost digit is 7.In the second case, 4 * 4 * 4 * 4 = 256, so the rightmost digit is 6.题目的意思是:求出n原创 2015-04-14 10:06:26 · 590 阅读 · 0 评论 -
Biker's Trip Odometer
输入: * 直径(英寸) 圈数 时间(s) * 输出: * trip #n: 距离(英里) 速度(英里/时) * 所有结果 保留两位小数这道题 不知道是哪里出错了 一直提示 ----- Wrong Answer ;找了好久没找到原因,我测试的时候 满足需求;这是我的代码public class PracticeI {public static原创 2015-04-13 11:30:28 · 431 阅读 · 0 评论 -
ACM Steps ---- Section1
这里挑选的是两个水题,输入和输出的练习Sample Input34 1 2 3 45 1 2 3 4 53 1 2 3Sample Output10156这道题的陷阱在于 输出结果 之间存在 一个空格 最后一个结果之后没有空格;import java.util.Scanner;public class PracticeV原创 2015-04-13 11:23:14 · 365 阅读 · 0 评论 -
find your present (2)
Each present has a card number on it, and your present's card number will be the one that different from all the others, and you can assume that only one number appear odd times.For example, there are原创 2015-04-13 11:39:31 · 509 阅读 · 0 评论 -
ACM Steps ---- Section1
之前一直有同学的在搞算法,经过我这半年的工作时间来看,算法才是最有水平的,很有技术含量,不管做什么开发,算法的思想一直会在你的脑海中,随时随地都能够用得上;我这里都是用Java来做的(用Java来写很占内存, 会出现很多问题,之后会介绍)。Sample Input4 1 2 3 45 1 2 3 4 50 Sample Output1015原创 2015-04-13 10:52:03 · 459 阅读 · 0 评论 -
HDU 排序
Sample Input0051231232050775Sample Output0 77 12312320对于输入的字符串,如果5在字符串的头部,会产生一个空串;对于5在字符串的末尾则不考虑;import java.util.ArrayList;import java.util.Collections;import java.util.List;impor原创 2015-04-22 10:43:33 · 646 阅读 · 0 评论 -
HDU shǎ崽 OrOrOrOrz
Sample Input51 2 3 4 5Sample Output5 1 4 2 3import java.util.ArrayList;import java.util.List;import java.util.Scanner;public class PracticeV {public static void main(String[] arg原创 2015-04-22 10:41:17 · 530 阅读 · 0 评论 -
HDU 开门人和关门人
Sample Input31ME3021112225321 00:00:00 23:59:592EE301218 08:05:35 20:56:35MA301134 12:35:45 21:40:423CS301111 15:30:28 17:00:10SC3021234 08:00:00 11:25:25CS301133 21:45:00 21:58:40原创 2015-04-22 10:40:49 · 483 阅读 · 0 评论 -
HDU Lowest Bit
Sample Input26880Sample Output28import java.util.Scanner;public class PracticeVII {public static void main(String[] args) {Scanner sc = new Scanner(System.in);int a;while(s原创 2015-04-22 10:33:09 · 520 阅读 · 0 评论 -
HDU The Seven Percent Solution
---Sample InputHappy Joy Joy!http://icpc.baylor.edu/icpc/plain_vanilla(**)?the 7% solution#---Sample OutputHappy%20Joy%20Joy%21http://icpc.baylor.edu/icpc/plain_vanilla%28%2a%2原创 2015-04-22 10:31:39 · 632 阅读 · 0 评论 -
HDU FatMouse' Trade
Sample Input5 37 24 35 220 325 1824 1515 10-1 -1Sample Output13.33331.500思路:这是一个典型的 贪心算法;老鼠得到的数量要是最大:x/y的比率越大,对于老鼠来说越划算,所以应该尽可能的先计算比率大的;import java.io.BufferedInputStrea原创 2015-04-22 10:39:25 · 558 阅读 · 0 评论 -
HDU Specialized Four-Digit Numbers
Find and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits when represented in hexadecimal (base 16) notation and also原创 2015-04-22 10:37:53 · 602 阅读 · 0 评论 -
排序算法之快速排序
把整个序列看做一个数组,把第零个位置看做中轴,和最后一个比,如果比它小交换,比它大不做任何处理;交换了以后再和小的那端比,比它小不交换,比他大交换。这样循环往复,一趟排序完成,左边就是比中轴小的,右边就是比中轴大的,然后再用分治法,分别对这两个独立的数组进行排序。 ` public int getMiddle(Integer[] list, int low, int high) {原创 2015-05-05 21:45:16 · 563 阅读 · 0 评论
分享