随笔分类 - 每日一题
摘要:There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one digit f
阅读全文
摘要:In a far away galaxy there is war again. The treacherous Republic made k precision strikes of power ai on the Empire possessions. To cope with the rep
阅读全文
摘要:Bike is interested in permutations. A permutation of length n is an integer sequence such that each integer from 0 to (n - 1) appears exactly once in
阅读全文
摘要:Problem Description The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the
阅读全文
摘要:n个人,每个人ci的金币,每天最富有的人都会给最贫穷的人1金币,问k天后最富有人和最贫穷的人差了多少金币。 数据 1 <= n <= 5e5, 0 <= k <= 1e9, 1 <= ci <= 1e9。 输入 4 1 1 1 4 2 3 1 2 2 2 输出 2 0 说明 对于样例1, [1,1,
阅读全文
摘要:第一次感觉vector有很多的用法,我们可以在vector里面进行删除和修改操作,复杂度都是log(n)还有就是lower_bound()和upper_bound() 加上这些的东西,感觉stl解决的问题就是更多了。 lower_bound(): 在first和last的前闭后开区间进行二分查找,返
阅读全文
摘要:题意 输入a,找到满足n!>a^n 最小的n。 数据 第一行T(1 <= T <= 1e5),表示测试样例数.(2 <= a <= 1e6)。 输入 3 2 3 4 输出 4 7 9 这个东西一看就知道是二分求解的,但是我们还是不知道怎么求的,我们可以吧他们取对数然后我们很惊奇的发现原来真的是取对数
阅读全文
摘要:题意 给出一个字符串,包含'(',')','?'三种字符,将一个'?'变为左括号需要花费ai,将一个'?'变成右括号需要花费bi 求将字符串变为合法括号序列的最小代价和此时的合法括号序列,无解输出'-1' 数据 字符串长度为偶数,长度 <= 5*10^4, 1 <= ai,bi <= 10^6 输入
阅读全文
摘要:给出一个正奇数K,两个正整数low,high。 有多少整数属于[low, high],且包含K个因子。 数据 C(0 < C < 1e5),测试样例数。 (1 < K < 10000, 0 < low <= high < 1e10)。 输入 3 3 2 49 9 1 100 5 55 235 输出
阅读全文

浙公网安备 33010602011771号