1257: You are my brother 时间限制: 1 Sec 内存限制: 128 MB提交: 39 解决: 15[提交][状态][讨论版] 题目描述 Little A gets to know a new friend, Little B, recently. One day, they realize that they are family 500 years ago. Now, Little A wants to know whether Little B is his e…
题目描述 Little A gets to know a new friend, Little B, recently. One day, they realize that they are family 500 years ago. Now, Little A wants to know whether Little B is his elder, younger or brother. 输入 There are multiple test cases. For each test case…
1257: [CQOI2007]余数之和sum Time Limit: 5 Sec Memory Limit: 162 MBSubmit: 3769 Solved: 1734[Submit][Status][Discuss] Description 给出正整数n和k,计算j(n, k)=k mod 1 + k mod 2 + k mod 3 + - + k mod n的值,其中k mod i表示k除以i的余数.例如j(5, 3)=3 mod 1 + 3 mod 2 + 3 mod 3 + 3…
http://acm.hdu.edu.cn/showproblem.php?pid=1257 最少拦截系统 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15379 Accepted Submission(s): 6128 Problem Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截…
最少拦截系统 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 35053 Accepted Submission(s): 13880 Problem Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的…
FJNU 1154 Fat Brother And His Love(胖哥与女神) Time Limit: 2000MS Memory Limit: 257792K [Description] [题目描述] As we know, fat Brother and his goddess is in a same city. The city is consist of N locations and the N locations is connected by M roads. Fat B…
FJNU 1153 Fat Brother And XOR(胖哥与异或) Time Limit: 1000MS Memory Limit: 257792K [Description] [题目描述] Fat brother had master ACM, recently he began to study the operation of XOR (the operation “^”). He thought of a very interesting question: select ar…
FJNU 1155 Fat Brother’s prediction(胖哥的预言) Time Limit: 1000MS Memory Limit: 257792K [Description] [题目描述] Fat Brother is a famous prophet, One day he get a prediction that disaster will come after X days. He is too nervous that sudden die. Fortunatel…
FJNU 1152 Fat Brother And Integer(胖哥与整数) Time Limit: 1000MS Memory Limit: 257792K [Description] [题目描述] Fat brother recently studied number theory, him came across a very big problem — minimum does not appear positive integer. Fat brother get n posi…
FJNU 1156 Fat Brother’s Gorehowl(胖哥的血吼) Time Limit: 1000MS Memory Limit: 257792K [Description] [题目描述] Fat Brother is a Great warrior(战士) and he has a powerful weapons named “Gorehowl”. Firstly it can cause 7 damage points to the other side, but it…
FJNU 1151 Fat Brother And Geometry(胖哥与几何) Time Limit: 1000MS Memory Limit: 257792K [Description] [题目描述] Fat brother enrolled in computer graphics, recently teacher arranged a job: given two straight lines and a circle, judge if the round is between…
FJNU 1157 Fat Brother’s ruozhi magic(胖哥的弱智术) Time Limit: 1000MS Memory Limit: 257792K [Description] [题目描述] Fat Brother is a powerful magician. Both he and his enemy has N soldiers and each soldier has IQ. When two soldier is in PK, the one whose IQ…
FJNU 1159 Fat Brother’s new way(胖哥的新姿势) Time Limit: 1000MS Memory Limit: 257792K [Description] [题目描述] I bet, except Fat Brothers, all of you don’t like strange way to show integers , he is really like this way to showing integers: 1 -> ‘A’ 2 -> ‘B…
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1257 Problem Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹. 怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺…
You are my brother 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 Little A gets to know a new friend, Little B, recently. One day, they realize that they are family 500 years ago. Now, Little A wants to know whether Little B is his elder, younger or brothe…
题目链接题意: 给定n,k,求 ∑(k mod i) {1<=i<=n} 其中 n,k<=10^9. 即 k mod 1 + k mod 2 + k mod 3 + … + k mod n的值. 我们先来看商之和. 给定n,k,求∑(k/i) {1<=i<=n} 其中/为整除. 可以得到一个引理,k/i值的个数不超过2*√k种.证明:k整除小于√k的数,都会有一个不同的结果:k整除大于√k的数,结果肯定小于√k,所以最多也只能有√k种结果. 于是我们可以枚举结果的取值累加.是…
1257: [CQOI2007]余数之和sum Time Limit: 5 Sec Memory Limit: 162 MBSubmit: 1779 Solved: 823[Submit][Status] Description 给出正整数n和k,计算j(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的值,其中k mod i表示k除以i的余数.例如j(5, 3)=3 mod 1 + 3 mod 2 + 3 mod 3 + 3 mod 4 + 3…
题目链接:BZOJ - 1257 题目分析 首先, a % b = a - (a/b) * b,那么答案就是 sigma(k % i) = n * k - sigma(k / i) * i (1 <= i <= n) 前面的 n * k 很容易算,那么后面的 sigma(k / i) * i,怎么办呢? 我们可以分情况讨论,就有一个 O(sqrtk) 的做法. 1)当 i < sqrtk 时,直接枚举算这一部分. 2)当 i >= sqrtk 时, k / i <=…