[CF简单介绍] 提交链接:A. Lala Land and Apple Trees 题面: A. Lala Land and Apple Trees time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Amr lives in Lala Land. Lala Land is a very beautiful country tha…
A. Lala Land and Apple Trees Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/558/problem/A Description Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous…
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere. Lala Land has exactly n apple trees. Tree number i is located in a position xi and has ai…
# [Codeforces #312 div2 A]Lala Land and Apple Trees 首先,此题的大意是在一条坐标轴上,有\(n\)个点,每个点的权值为\(a_{i}\),第一次从原点开始走,方向自选(<- or ->),在过程中,若遇到一个权值>0的点,则将此权值计入答案,并归零.当次.此方向上的所有点均为0后,输出此时的答案. 然后,进行分析: 我们很容易想到这是一个贪心,我们将正的和负的分别存入两个数组,最初的方向为: \(zhengsum > fusum…
Codeforces Round #601 (Div. 2) ---- 比赛传送门 周二晚因为身体不适鸽了,补题补题 A // http://codeforces.com/contest/1255/problem/A /* 签到题 简单的贪心题 本考虑过是否有先小于再加上去会更小的情况 但两种情况恰好步数是一样的 */ #include<iostream> #include<cstdio> #include<cmath> using namespace std; int…
Codeforces Round #600 (Div. 2) ---- 比赛传送门 昨晚成绩还好,AC A,B题,还能上分(到底有多菜) 补了C.D题,因为昨晚对C.D题已经有想法了,所以补起题来也快.(C题TLE了,D题想用并查集没好) A // http://codeforces.com/contest/1253/problem/A /* 如果YES,则b[i] - a[i] 在一个区间里的差肯定是相同的且不小于0 */ #include<iostream> #include<cst…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees grow…
比赛传送门 只能说当晚状态不佳吧,有点头疼感冒的症状.也跟脑子没转过来有关系,A题最后一步爆搜没能立即想出来,B题搜索没有用好STL,C题也因为前面两题弄崩了心态,最后,果然掉分了. A:简单数学 B:数学+排序 C:字符串搜索 A // https://codeforces.com/contest/1277/problem/A /* 题意: 给出一个数,求不大于该数的完美整数的个数(完美整数指全是一个数组成的数字,如:111, 333333, 444444, 9, 8888 ...) 分析:…
C. Amr and Chemistry Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/558/problem/C Description Amr loves Chemistry, and specially doing experiments. He is preparing for a new interesting experiment. Amr has n different type…
B. Amr and The Large Array Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/558/problem/B Description Amr has got a large array of size n. Amr doesn't like large arrays so he intends to make it smaller. Amr doesn't care abou…