
acm
文章平均质量分 70
cstur4
lllllll
展开
-
Do the Untwist
Do the UntwistTime Limit: 2 Seconds Memory Limit: 65536 KBCryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the cip原创 2012-11-08 10:39:38 · 504 阅读 · 0 评论 -
Crashing Balloon from http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3
On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV. The rule is very simple. On the ground there are 100 labeled balloons, with the numbers 1 to 100. Afte原创 2012-09-23 21:46:44 · 788 阅读 · 0 评论 -
Fire Net from http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=2
Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall.A blockhouse is a small castle th原创 2012-09-23 20:30:48 · 1070 阅读 · 0 评论 -
中国剩余定理
一个数被3除余1,被4除余2,被5除余4,这个数最小是几?题中3、4、5三个数两两互质。则〔4,5〕=20;〔3,5〕=15;〔3,4〕=12;〔3,4,5〕=60。为了使20被3除余1,用20×2=40;使15被4除余1,用15×3=45;使12被5除余1,用12×3=36。然后,40×1+45×2+36×4=274,因为,274>60,所以,274-60×4=34,就是所求的数。可以看出,原创 2012-09-07 18:03:44 · 871 阅读 · 0 评论 -
Problem 1046 Tempter of the Bone, from http://acm.fzu.edu.cn/problem.php?pid=1046
Problem 1046 Tempter of the BoneAccept: 509 Submit: 1504Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionThe doggie found a bone in an ancient maze, which fascina原创 2012-09-03 19:59:55 · 577 阅读 · 0 评论 -
Jugs
JugsTime Limit: 2 Seconds Memory Limit: 65536 KB Special JudgeIn the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given原创 2012-11-06 10:27:48 · 9142 阅读 · 0 评论 -
Problem 1582 众数问题 from http://acm.fzu.edu.cn/problem.php?pid=1582
Problem Description给定含有n个元素的多重集合S,每个元素在S中出现的次数称为该元素的重数。多重集S中重数最大的元素称为众数。例如,S={1,2,2,2,3,5}。多重集S的众数是2,其重数为3。 Input输入包括多组数据,请处理到EOF结束。每组数据,以一个n(131~231)。 Output对于每组输入数据,输原创 2012-10-27 01:18:32 · 857 阅读 · 0 评论 -
Problem 1478 环形整数串 from http://acm.fzu.edu.cn/problem.php?pid=1478
Problem Description你知道最大和子串问题么? 就是给你一个整数串,要你求出其中的一个连续子串,要求其和最大。比如: 串是 -2 2 0 1 -48 1,显然其最大和连续子串是2 0 1,其和是3。现的问题是如果求环形整数串的最大连续和子串呢?请编写一个程序解决这个问题。 Input本题有多组输入数据,你必须处理到EOF为止每组数据的原创 2012-10-27 01:18:54 · 806 阅读 · 0 评论 -
Problem 1607 Greedy division from http://acm.fzu.edu.cn/problem.php?pid=1607
Problem DescriptionOaiei has inherited a large sum of wealth recently; this treasure has n pieces of golden coins. Unfortunately, oaiei can not own this wealth alone, and he must divide this wea原创 2012-10-27 01:18:00 · 895 阅读 · 0 评论 -
背包小模板
[cpp] view plaincopyfor(i=1;i //for(j=0;j for(j=(int)maxx;j>=bill[i];j--) 只选择一次 { if(j>=bill[i])原创 2012-10-22 16:21:31 · 323 阅读 · 0 评论 -
Problem 1057 ab from http://acm.fzu.edu.cn/problem.php?pid=1057
Problem 1057 abAccept: 818 Submit: 2644Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description对于任意两个正整数a,b(0b各位数字的和的各位数字的和的各位数字的和的各位数字的和。 Input输入有多组数据,每组只有一行,包含两个正整数a原创 2012-09-05 15:30:31 · 961 阅读 · 0 评论 -
Problem 1078 计算循环冗余码
Problem Description计算机网络中采用循环冗余码来校验数据的正确性。其原理是:发送方计算出待发送的二进制数据的循环冗余码,并随同原数据一起发送到接收方;接收方通过重新计算接收到的数据的循环冗余码,并和收到的循环冗余码进行比较,如果两者相同则可判定所收到的数据是正确的,否则说明数据是错误的。其中计算二进制数据的循环冗余码的计算过程如下:1.协议事先约定一个二进制生成表达式原创 2012-09-05 18:42:08 · 774 阅读 · 0 评论 -
Problem 1202 信与信封问题 from http://acm.fzu.edu.cn/problem.php?pid=1202
Problem 1202 信与信封问题Accept: 207 Submit: 1069Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionJohn先生晚上写了n封信,并相应地写了n个信封将信装好,准备寄出。但是,第二天John的儿子Small John将这n封信都拿出了信封。不原创 2012-09-11 15:29:00 · 1615 阅读 · 0 评论 -
KMP算法,so cool
#include#include#include#include#include#includeusing namespace std;char str[1000001] = ".hello, abcd";char target[] = ".abcd";int next[1000001];void getNext(){ int j=0; int len = st转载 2012-09-04 11:11:27 · 327 阅读 · 0 评论 -
Problem 1404 Andy的作业
#include #include #include #include #include using namespace std;#define MAX 10000000000ULLlong long a[801];long long res[101];long long carry;long long tmp;void multi(int start, int end)原创 2012-09-07 20:59:46 · 423 阅读 · 0 评论 -
Problem 1410 变位词 from http://acm.fzu.edu.cn/problem.php?pid=1410
Problem 1410 变位词Accept: 546 Submit: 1584Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionMr. Right有一个奇怪的嗜好,就是看见一个单词就有找它所有的变位词的冲动。一个单词的变位词就是该单词所有字母的一个排列。 Input输入原创 2012-09-11 10:27:06 · 1009 阅读 · 0 评论 -
Problem 1453 Bignum Arithmetic from http://acm.fzu.edu.cn/problem.php?pid=1453
Problem 1453 Bignum ArithmeticAccept: 399 Submit: 1028Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionIn this problem, you will be concerned with integers with v原创 2012-09-11 09:44:33 · 729 阅读 · 0 评论 -
Problem 1207 半数集问题 from http://acm.fzu.edu.cn/problem.php?pid=1207
Problem 1207 半数集问题Accept: 1200 Submit: 3595Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description给定一个自然数n,由n开始可以依次产生半数集set(n)中的数如下。(1)n∈set(n); (2)在n的左边加上一个自然数,但该自然数原创 2012-09-11 15:19:38 · 1336 阅读 · 0 评论 -
Problem 1106 Sum of Factorials
#include#include#include#include#include#include#includeusing namespace std;/* 1. 1!+2!+...+n!= (n+1)!, must contains (n+1)! 2. 0!=1, should be contained. 3. n=0 should be concentr原创 2012-08-31 18:50:21 · 372 阅读 · 0 评论