随笔分类 -  搜索

摘要:DescriptionA common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips,S1andS2, each stack containingCchips. Each stack may contain chips of several different colors.The actual shuffle operation is perform 阅读全文
posted @ 2013-06-01 15:31 欧阳生朵 阅读(1062) 评论(0) 推荐(0)
摘要:描述为了准备一个独特的颁奖典礼,组织者在会场的一片矩形区域(可看做是平面直角坐标系的第一象限)铺上一些矩形地毯。一共有n张地毯,编号从1到n。现在将这些地毯按照编号从小到大的顺序平行于坐标轴先后铺设,后铺的地毯覆盖在前面已经铺好的地毯之上。地毯铺设完成后,组织者想知道覆盖地面某个点的最上面的那张地毯的编号。注意:在矩形地毯边界和四个顶点上的点也算被地毯覆盖。格式输入格式输入共n+2行。第一行,一个整数n(0 <= n <= 10,000),表示总共有n张地毯。接下来的n行中,第i+1行表示编号i的地毯的信息,包含四个正整数a,b,g,k(0 <= a, b, g, k < 阅读全文
posted @ 2013-04-10 12:28 欧阳生朵 阅读(383) 评论(0) 推荐(1)