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…
[codeforces 317]A. Perfect Pair 试题描述 Let us call a pair of integer numbers m-perfect, if at least one number in the pair is greater than or equal to m. Thus, the pairs (3, 3) and (0, 2) are 2-perfect while the pair (-1, 1) is not. Two integers x, y a…
B. Strings of Power Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/318/problem/C Description Let us call a pair of integer numbers m-perfect, if at least one number in the pair is greater than or equal to m. Thus, the pair…
A continued fraction of height n is a fraction of form . You are given two rational numbers, one is represented as and the other one is represented as a finite fraction of height n. Check if they are equal. Input The first line contains two space-se…
题目链接:http://codeforces.com/problemset/problem/892/A 具体的Java 中 sort实现降序排序:https://www.cnblogs.com/youpeng/p/10546797.html Ac代码: import java.util.Comparator; import java.util.Scanner; import static java.util.Arrays.sort; public class Main { public stat…
http://codeforces.com/contest/318/problem/C #include <cstdio> #include <cstring> #include <algorithm> using namespace std; long long j; long long x,y,m; int main() { scanf("%I64d%I64d%I64d",&x,&y,&m); if(x>=m||y&…