随笔分类 - ACM---基础
摘要:B. Dima and To-do Listtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou helped Dima to have a great weekend, but it's time to work. Naturally, Dima, as all other men who have girlfriends, does everything wrong.Inna and Dima are now in one ro
阅读全文
摘要:Crossing RiverTime Limit:1000MSMemory Limit:10000KTotal Submissions:9887Accepted:3737DescriptionA group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the boat back and forth
阅读全文
摘要:Alice's Print ServiceTime Limit: 2 Seconds Memory Limit: 65536 KBAlice is providing print service, while the pricing doesn't seem to be reasonable, so people using her print service found some tricks to save money.For example, the price when printing less than 100 pages is 20 cents per page,
阅读全文
摘要:最长回文Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6336Accepted Submission(s): 2197Problem Description给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c...y,z组成的字符串S两组case之间由空行隔开(该空行不用处理
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int tom,root,wi; 8 typedef struct node 9 {10 int a[2];11 int i;12 int num;13 }Tril;14 Tril f[100003=0;i--)20 {21 k=( (1=0;i--)33 {34 k=( (1tom )41 {42 tom=cur^x;43 wi=i;44...
阅读全文
摘要:Problem 2138 久违的月赛之一Accept: 40 Submit: 86 Time Limit: 1000 mSec Memory Limit : 32768 KBProblem Description好久没举月赛了,这次lqw给大家出了5道题,因为hsy学长宣传的很到位,吸引了n个DDMM们来做,另一位kk学长说,全做对的要给金奖,做对4题要给银奖,做对3题要给铜奖。统计数据的时候,发现每题分别在n个人中有n1、n2、n3、n4、n5个人通过,lqw灵机一动,问kk:“你猜,这次至少会有多少个人获奖?”由于题目太简单了,每题的通过人数一定大于等于最低获奖人数。Input第一行一个数
阅读全文
摘要:Problem 2136 取糖果Accept: 39 Submit: 101 Time Limit: 1000 mSec Memory Limit : 32768 KBProblem Description有N个袋子放成一排,每个袋子里有一定数量的糖果,lzs会随机选择连续的几个袋子,然后拿走这些袋子中包含最多糖果的袋子。现问你,在选择x个袋子的情况下,lzs最坏情况下,也就是最少会拿到多少个糖果?对于x取值为1到n都分别输出答案。Input第一行一个整数T,表示有T组数据。每组数据先输入一行一个整数N(1 2 3 4 struct node 5 { 6 int l; 7 ...
阅读全文
摘要:1215: 稳定排序Time Limit: 2 Sec Memory Limit: 128 MB Submit: 111 Solved: 43 [Submit][Status][Web Board]Description给出二元数组a[MAXN][2],按第一个关键值从小到大排序后输出,要求第一关键值相同情况下不改变原数组次序Input每组数据第一行为整数n,1 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 struct node 9 {10 int a;11 int b;12 ...
阅读全文
摘要:1213: 二叉树结点公共祖先Time Limit: 1 Sec Memory Limit: 128 MB Submit: 159 Solved: 87 [Submit][Status][Web Board]Description一个顺序存储的完全二叉树: 1 / \ 23 / \ / \ 4 5 6 7 ...任意给定两结点的编号,求两结点最近的公共祖先。Input每组数据一行,为空格隔开的两个数i和j,皆为32位有符号正整数Output每组数据对应一行,为编号为i和j的结点的最近公共祖先的编号Sample Input4 54 7Sample Output21 1 #include 2 3.
阅读全文
摘要:1216: 异或最大值Time Limit: 2 Sec Memory Limit: 128 MB Submit: 98 Solved: 29 [Submit][Status][Web Board]Description给定一些数,求这些数中两个数的异或值最大的那个值Input第一行为数字个数n,1 2 #include 3 #include 4 5 typedef struct 6 { 7 int a[2]; 8 int num; 9 }Tril;10 Tril f[100010=0;i--)17 {18 k=(1=0;i--)29 {30...
阅读全文
摘要:Binary OperationsTime Limit: 2000 ms Memory Limit: 65535 kB Solved: 56 Tried: 674 DescriptionBob has a sequence of N integers. They are so attractive, that Alice begs to have a continued part of it(a continued part here also means a continued subsequence). However, Bob only allows Alice to chose it
阅读全文
摘要:Key LoggerTime Limit:3000msCase Time Limit:3000msMemory Limit:65536KB64-bit integer IO format:%lld Java class name:MainSubmitStatusPID: 29373Font Size:+-Decode the message from the given key logger. The logger consists:’-’ representing backspace: the character directly before the cursor position is
阅读全文
摘要:Adidas vs AdivonTime Limit:1000msMemory Limit:65536KB64-bit integer IO format:%lld Java class name:MainPrevSubmitStatusStatisticsDiscussNextFont Size:+-Type:Tag it!“我们坐在高高的土堆上面,听妈妈讲阿迪王的事情。我出生在一个不太普通的家庭,妈妈会预知术,在我小的时候,妈妈就常跟我说:‘在未来的世界,有一种叫阿迪王的东西成为比石油、黄金还重要的东西……’那时,我痴痴地听着,一听就到半夜,听到入迷,任由鼻涕流到自己的嘴里。长大后,我终于
阅读全文
摘要:Problem F: ZZY and his little friendsTime Limit: 5 SecMemory Limit: 256 MBSubmit: 137Solved: 70[Submit][Status][Web Board]Description zzy养了一只小怪兽和N只凹凸曼,单挑的话每只凹凸曼都不是小怪兽的对手,所以必须由两只凹凸曼合作来和小怪兽战斗。凹凸曼A和凹凸曼B合作的战斗力为他们战斗力的异或值。现在由zzy从N只凹凸曼中选出两只来和小怪兽战斗。请问zzy能否选出两只凹凸曼使他们能够战胜小怪兽(他们的战斗力比小怪兽大)。Input 输入有多个例子,直到文件结束。
阅读全文
摘要:Plants vs. ZombiesTime Limit:5000msMemory Limit:2048KB64-bit integer IO format:%lld Java class name:MainPrevSubmitStatusStatisticsDiscussNextFont Size:+-Type:Tag it!植物大战僵尸(Plants vs. Zombies)是一款风靡全球的小游戏,游戏中可怕的僵尸即将入侵你的家庭,你唯一的防御方式就是你栽种的植物。一天早上起床,你惊讶地发现,游戏变成了事实:一大堆各种各样的僵尸正准备入侵你的寝室!而且僵尸种类远远多于游戏中的(有10000
阅读全文
浙公网安备 33010602011771号