摘要: F. Isomorphic Stringstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are giv... 阅读全文
posted @ 2018-05-31 00:19 StarHai 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 描述题解二分加贪心。先确保前 ii 桶可以分配为相邻的 kk 个,并且保证 a[i∗k+j]−a[1]#include#includeusing namespace std;const int MAXN = 1e5 + 10;int n, k, l;int a[MAX... 阅读全文
posted @ 2018-05-30 22:31 StarHai 阅读(164) 评论(0) 推荐(0) 编辑
摘要: DescriptionOpen-pit mining is a surface mining technique of extracting rock or minerals from the earth by their removal from an open p... 阅读全文
posted @ 2018-05-27 22:14 StarHai 阅读(417) 评论(0) 推荐(0) 编辑
摘要: DescriptionAlice and Bob are in their class doing drills on multiplication and division. They quickly get bored and instead decide to ... 阅读全文
posted @ 2018-05-27 22:09 StarHai 阅读(372) 评论(0) 推荐(0) 编辑
摘要: Description車是中国象棋中的一种棋子,它能攻击同一行或同一列中没有其他棋子阻隔的棋子。一天,小度在棋盘上摆起了许多車……他想知道,在一共N×M个点的矩形棋盘中摆最多个数的車使其互不攻击的方案数。他经过思考,得出了答案。但他仍不满足,想增加一个条件:对于任何一... 阅读全文
posted @ 2018-05-24 22:18 StarHai 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Description小M听说会变魔术的男生最能吸引女生注意啦~所以小M费了九牛二虎之力终于学会了一个魔术:首先在桌面上放N张纸片,每张纸片上都写有一个数字。小M每次请女生给出一个数字x,然后划定任意一个区间[L,R],小M就能立马告诉对方这个区间内有多少个数字比x小... 阅读全文
posted @ 2018-05-24 22:16 StarHai 阅读(403) 评论(0) 推荐(0) 编辑
摘要: Description Most of the time when rounding a given number, it is customary to round to some multiple of a power of 10. However, the... 阅读全文
posted @ 2018-05-24 22:14 StarHai 阅读(266) 评论(0) 推荐(0) 编辑
摘要: DescriptionNow we have a number, you can swap any two adjacent digits of it, but you can not swap more than K times. Then, what is the... 阅读全文
posted @ 2018-05-24 22:13 StarHai 阅读(284) 评论(0) 推荐(0) 编辑
摘要: DescriptionIn the planet Pandora, Jake found an old encryption algorithm. The plaintext, key and ciphertext are all four decimal numbe... 阅读全文
posted @ 2018-05-24 22:12 StarHai 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Description Yucept21和他的室友Zyn因为宿舍没电去网吧上网,上了27分钟,Cs打电话来说来电了。所以Yucept21在第29分钟下机了,上网的费用是一块钱,然后Zyn墨迹了两分钟,第31分钟下机,上机费用是2元。现在知道网吧是按照半个小时计费的,假... 阅读全文
posted @ 2018-05-24 22:11 StarHai 阅读(353) 评论(0) 推荐(0) 编辑
摘要: Description 有一个N*N的字符矩阵,从上到下依次记为第1行,第2行,……,第N行,从左至右依次记为第1列,第2列,……,第N列。 对于这个矩阵会进行一系列操作,但这些操作只有两类: (1) R: 将矩阵逆时针旋转90度; (2) P... 阅读全文
posted @ 2018-05-24 22:10 StarHai 阅读(429) 评论(0) 推荐(0) 编辑
摘要: Description前段时间,某省发生干旱,B山区的居民缺乏生活用水,现在需要从A城市修一条通往B山区的路。假设有A城市通往B山区的路由m条连续的路段组成,现在将这m条路段承包给n个工程队(n ≤ m ≤ 300)。为了修路的便利,每个工程队只能分配到连续的若干条路... 阅读全文
posted @ 2018-05-24 22:09 StarHai 阅读(258) 评论(0) 推荐(0) 编辑
摘要: Description 在一个由N个整数组成的数列中,最多能找到多少个位置连续的整数且其中的最大值与最小值之差不超过K呢?Input 输入包含若干组数据。每组数据的第一行有2个正整数,N(1#include#include#includeusi... 阅读全文
posted @ 2018-05-23 23:09 StarHai 阅读(448) 评论(0) 推荐(0) 编辑
摘要: Description从m个不同元素中取出n (n ≤ m)个元素的所有组合的个数,叫做从m个不同元素中取出n个元素的组合数。组合数的计算公式如下:C(m, n) = m!/((m - n)!n!) 现在请问,如果将组合数C(m, n)写成二进制数,请问转这个二进制数... 阅读全文
posted @ 2018-05-23 23:07 StarHai 阅读(394) 评论(0) 推荐(0) 编辑
摘要: Description给定些数字,这些数中只有一个数出现了奇数次,找出这个数。Input每组数据第一行n表示数字个数,1 #include#include#includeusing namespace std;const int maxn=1e6+10;int a[m... 阅读全文
posted @ 2018-05-23 23:07 StarHai 阅读(391) 评论(0) 推荐(0) 编辑
摘要: DescriptionDanni想为屏幕上的一个矩形着色,但是她想到了一个问题。当点击鼠标以后电脑是如何判断填充的区域呢?现在给你一个平面直角坐标系,其中有一个矩形和一个点,矩形的四条边均是平行于x轴或y轴的。请你判断这个点相对于矩形的位置,即在矩形内,在矩形上,还是... 阅读全文
posted @ 2018-05-23 23:05 StarHai 阅读(255) 评论(0) 推荐(0) 编辑
摘要: DescriptionJames得到了一堆有趣的硬币,于是决定用这些硬币跟朋友们玩个小游戏。在一个N行M列的表格上,每一个第i行第j列的格子上都放有一枚James的硬币,抛该硬币正面朝上的概率为Pij,所有抛硬币事件两两之间是相互独立的。现在,玩家在M列硬币中,从每一... 阅读全文
posted @ 2018-05-23 23:04 StarHai 阅读(698) 评论(0) 推荐(0) 编辑
摘要: Description有三户人家共拥有一座花园,每户人家的太太均需帮忙整理花园。A 太太工作了5 天,B 太太则工作了4 天,才将花园整理完毕。C 太太因为正身怀六甲无法加入她们的行列,便出了90元。请问这笔钱如何分给A、B 二位太太较为恰当?A 应得多少元?90/(... 阅读全文
posted @ 2018-05-23 23:03 StarHai 阅读(481) 评论(0) 推荐(0) 编辑
摘要: Description数轴原点有一个机器人。该机器人将执行一系列指令,你的任务是预测所有指令执行完毕之后它的位置。·LEFT:往左移动一个单位·RIGHT: 往右移动一个单位·SAME AS i: 和第i 条执行相同的动作。输入保证i 是一个正整数,且不超过之前执行指... 阅读全文
posted @ 2018-05-23 23:03 StarHai 阅读(1180) 评论(0) 推荐(0) 编辑
摘要: DescriptionMr. Mindless has many balls and many boxes,he wants to put all the balls into some of the boxes.Now, he wants to know how m... 阅读全文
posted @ 2018-05-23 23:02 StarHai 阅读(391) 评论(0) 推荐(0) 编辑
摘要: DescriptionBinary Search Tree, abbreviated as BST, is a kind of binary tree maintains the following property:each node has a Key value... 阅读全文
posted @ 2018-05-23 23:01 StarHai 阅读(280) 评论(0) 推荐(0) 编辑
摘要: DescriptionACM小组的Samsara和Staginner对中国象棋特别感兴趣,尤其对马(可能是因为这个棋子的走法比较多吧)的使用进行深入研究。今天他们又在 构思一个古怪的棋局:假如Samsara只有一个马了,而Staginner又只剩下一个将,两个棋子都在... 阅读全文
posted @ 2018-05-23 22:59 StarHai 阅读(392) 评论(0) 推荐(0) 编辑
摘要: The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all pl 阅读全文
posted @ 2018-05-16 20:21 StarHai 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Jimmy wants to make a special necklace for his girlfriend. He bought many beads with various sizes, and no two beads are with the same... 阅读全文
posted @ 2018-05-16 20:18 StarHai 阅读(258) 评论(0) 推荐(0) 编辑
摘要: You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a ne 阅读全文
posted @ 2018-05-15 20:51 StarHai 阅读(247) 评论(0) 推荐(0) 编辑