随笔分类 -  Java学习

摘要:http://codeforces.com/problemset/problem/317/A题意:给两个数字,可以两数相加去替换其中一个数字。问要做多少次,可以让两个数字钟至少一个 >= 目标数字m,输出次数,不可能的话输出-1比较简单的题目,用来练习JAVA,代码写得有点,呵呵................import java.util.*;public class Main{ static long max(long x , long y){ return x > y ? x : y; } static long solve(long a ,long b ,l... 阅读全文
posted @ 2013-06-18 13:52 Titanium 阅读(427) 评论(0) 推荐(0)
摘要:题目1502:最大值最小化(二分答案)九度OJJavaimport java.util.Scanner; public class Main { public static int max(int x ,int y){ return x > y ? x : y; } public static int solve(int tot , int m , int n ,int a[]){ int low = 1 , high = tot; while(low <= high){ int mid = (... 阅读全文
posted @ 2013-06-17 20:05 Titanium 阅读(638) 评论(0) 推荐(0)