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&…
[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…
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…
A. Even Odds 奇数个数\(\lfloor \frac{n+1}{2}\rfloor\) B. Strings of Power 从位置0开始,统计heavy个数,若当前为metal,则可以和之前的所有heavy配对. C. Perfect Pair 假设\(x\le y\),显然用\(x+y\)替换\(x\)可以达到最少步数. \(x\)会一直\(+y\)直到\(x'\gt y\). D. Ants 暴力模拟??? E. Balance 构出一棵树后,就随便做了. F. Game w…
The Perfect Stall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 24081 Accepted: 10695 Description Farmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering p…
network namespace 创建network namespace # ip netns add blue # ip netns list blue 添加网口到namespace 先创建veth # ip link add veth0 type veth peer name veth1 在当前namespace可以看到veth0和veth1 # ip link list 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue st…
第一次参加CF的比赛,MSK19.30,四个小时的时差真心累,第一次CODE到这么夜-- 一开始做了A,C两题,后来做B题的时候我体力和精神集中度就很低了,导致一直WA在4-- 今天起床后再刷B,终于过了--坑爹. 来看题目: A. Mashmokh and Lights time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mash…
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example 1: Input: n = 12 Output: 3 Explanation: 12 = 4 + 4 + 4. Example 2: Input: n = 13 Output: 2 Explanation: 13 = 4 + 9.---…
[cf contest246] E - Blood Cousins Return time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Polycarpus got hold of a family tree. The found tree describes the family relations of n people, nu…
Perfect Election Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 438 Accepted: 223 Description In a country (my memory fails to say which), the candidates {1, 2 ..., N} are running in the parliamentary election. An opinion poll asks th…
Aizu 2249 & cf 449B 1.Aizu - 2249 选的边肯定是最短路上的. 如果一个点有多个入度,取价值最小的. #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb push_back #define rep(i, a, b) for(int i=(a); i<(b); i++) #defin…