计算12个数的和的平均数.四舍五入,不能有后导0. 我的做法是,将答案算出后,乘以1000,然后看个位是否大于等于5,判断是否要进位…… #include<iostream> #include<cstdio> #include<string.h> #include<cmath> #include<algorithm> using namespace std; #define eps 1e-2 int main() { int cas; scanf…
dp[ba][ta][bb][tb]表示a堆牌从下面拿了ba张,从上面拿了ta张.b堆牌从下面拿了bb张,从上面拿了tb张.当前玩家能得到的最大的分数. 扩展方式有4种,ba+1,ta+1,bb+1,tb+1,用当前剩下牌的总分减掉它,取最大值,就是当前玩家的最高分. 记忆化搜索 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<cstrin…
题意:给定n个点和m条边,问你拆掉前i条边后,整个图的连同城市的数量. i从1到m. 思路:计算连通的城市,很容易想到并查集,但是题目里是拆边,所以我们可以反向去做. 存下拆边的信息,从后往前建边. #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct node { int a,b; }Q[100005];…
A. Tutor Description Lilin was a student of Tonghua Normal University. She is studying at University of  Chicago now. Besides studying, she worked as a tutor teaching Chinese to Americans. So,  she can earn some money per month. At the end of the yea…
点击打开链接 D.D-City Description Luxer is a really bad guy. He destroys everything he met. One day Luxer went to D-city. D-city has N D-points and M D-lines. Each D-line  connects exactly two D-points. Luxer will destroy all the D-lines. The mayor of D-ci…
乱七八糟 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 一天,PIAOYI查看班级成绩时发现各种乱七八糟的数据,有点晕--但是他现在非常想知道排名情况,你能帮帮他吗?为了让问题简化,只给出n个同学的总成绩,然后需要你对所有同学的总成绩进行排名(从高到低)然后询问m次,每次询问的是总成绩排名是第xi名的同学有多少个? 注意:1)总成绩相等的同学排名是一样的,并列一个名次.            2)若排名在x同学前面的成绩有并列的,在对x排名时,要加上并列的同学.说…
Tutor Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 47    Accepted Submission(s): 26 Problem Description Lilin was a student of Tonghua Normal University. She is studying at University of Chic…
Hard Disk Drive Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 83    Accepted Submission(s): 48 Problem Description Yesterday your dear cousin Coach Pang gave you a new 100MB hard disk drive (H…
Zhuge Liang's Password Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 59    Accepted Submission(s): 47 Problem Description In the ancient three kingdom period, Zhuge Liang was the most famous a…
Hehe Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 33    Accepted Submission(s): 22 Problem Description As we all know, Fat Brother likes MeiZi every much, he always find some topic to talk wi…