随笔分类 -  枚举

铺地毯 / 洛谷P1003
摘要:为了准备一个独特的颁奖典礼,组织者在会场的一片矩形区域(可看做是平面直角坐标系的第一象限)铺上一些矩形地毯。一共有 n 张地毯,编号从 1 到 n。现在将这些地毯按照编号从小到大的顺序平行于坐标轴先后铺设,后铺的地毯覆盖在前面已经铺好的地毯之上。 地毯铺设完成后,组织者想知道覆盖地面某个点的最上面的 阅读全文

posted @ 2020-02-29 22:48 LT-Y 阅读(102) 评论(0) 推荐(0)

Maximum Subsequence / CodeForces - 888E
摘要:Input The first line contains two integers n and m (1 ≤ n ≤ 35, 1 ≤ m ≤ 109). The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109). Outp 阅读全文

posted @ 2020-02-29 20:36 LT-Y 阅读(101) 评论(0) 推荐(0)

Xor Sum 2 / AtCoder - 4142
摘要:Input Input is given from Standard Input in the following format: N A1 A2 … An Output Print the number of the pairs of integers l and r(1 <= l <= r <= 阅读全文

posted @ 2020-02-29 18:28 LT-Y 阅读(167) 评论(0) 推荐(0)

Flip Game / POJ 1753
摘要:Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other o 阅读全文

posted @ 2020-02-29 11:25 LT-Y 阅读(146) 评论(0) 推荐(0)

Subsequence / UVA - 1121
摘要:A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Wri 阅读全文

posted @ 2020-02-29 11:16 LT-Y 阅读(127) 评论(0) 推荐(0)