摘要:题目链接:https://codeforces.com/contest/185/problem/A 题目大意就是求n次以后 方向朝上的三角形的个数 以前写过这个题,但是忘了怎么做的了,,,又退了一遍,发现第n次后 总个数为2^n+(2^n+!)/2个,,但是部分数据过不去,可能是卡long long
阅读全文
09 2019 档案
摘要:题目链接:https://codeforces.com/contest/185/problem/A 题目大意就是求n次以后 方向朝上的三角形的个数 以前写过这个题,但是忘了怎么做的了,,,又退了一遍,发现第n次后 总个数为2^n+(2^n+!)/2个,,但是部分数据过不去,可能是卡long long
阅读全文
摘要:题目链接 :http://acm.hdu.edu.cn/showproblem.php?pid=1506 Problem Description A histogram is a polygon composed of a sequence of rectangles aligned at a co
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2531 题解 :这个题目的坑就是D的个数,一开始天真的一位就2个,不是这样的,D的数目是不定的。所以我们先找到一个D,让这个D做为头,然后再用一个数组记录其他D与该D的相对位置就好了,然后再BFS判断
阅读全文
摘要:The only difference between easy and hard versions is the number of elements in the array. You are given an array aa consisting of nn integers. In one
阅读全文
摘要:题目链接:https://codeforces.com/contest/1230/problem/C 题目大意:21枚多米诺牌,给你一个图,将多米诺牌放到图的边上,由同一个点发出的所有边,边上多米诺牌对应该点的一侧相同。 such as: 题解:暴力枚举,即先给每个点一个值,然后判断在这种情况下可以
阅读全文
摘要:这个题目的题意有点难搞 题目连接: https://atcoder.jp/contests/abc137/tasks/abc137_d 题目大意:输入n和m 指的是一共有n个输入在m天前一共能赚到的钱为多少,输入x,y,分别指的是在x天后可以赚到y. 题解:贪心。。。这道题错了好多次。 正解:我们用
阅读全文
摘要:D - A Bug's Life 二分图 并查集 BackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two dif
阅读全文
摘要:B B - Local Extrema CodeForces - 888A You are given an array a. Some element of this array ai is a local minimum iff it is strictly less than both of
阅读全文
摘要:https://www.luogu.org/problem/P1162 由数字00组成的方阵中,有一任意形状闭合圈,闭合圈由数字11构成,围圈时只走上下左右44个方向。现要求把闭合圈内的所有空间都填写成22.例如:6 \times 66×6的方阵(n=6n=6),涂色前和涂色后的方阵如下: 0 0
阅读全文
摘要:A 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 mu
阅读全文
摘要:You may have already known that a standard ICPC team consists of exactly three members. The perfect team however has more restrictions. A student can
阅读全文
摘要:https://www.luogu.org/problem/P1903 后台数据太强了,只得了60分 题目描述 墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问。墨墨会向你发布如下指令: 1、 Q L R代表询问你从第L支画笔到第R支画笔中共有几种不同颜色的画笔。
阅读全文
摘要:连接 https://ac.nowcoder.com/acm/contest/1085/G 链接:https://ac.nowcoder.com/acm/contest/1085/G来源:牛客网 题目描述 小sun最近突然对区间来了兴趣,现在他有这样一个问题想问问你: 给你n个数,每个数为aia_i
阅读全文
摘要:http://www.51nod.com/Challenge/TopicProblemList.html#topicId=291 二分答案思路就是先确定好答案的范围,一般越大越好,去个left为答案的最小取值,right为答案的最大取值 然后二分,,同时判断当前状态时候满足答案,如果满足的话,还要考
阅读全文
摘要:All of us love treasures, right? That's why young Vasya is heading for a Treasure Island. Treasure Island may be represented as a rectangular table n×
阅读全文
摘要:例题1 1010 只包含因子2 3 5的数 http://www.51nod.com/Challenge/Problem.html#problemId=1010 K的因子中只包含2 3 5。满足条件的前10个数是:2,3,4,5,6,8,9,10,12,15。 所有这样的K组成了一个序列S,现在给出
阅读全文
摘要:勾股定理 : 当其中一个数a大于1并且为奇数时即a=2*n+1, 那么另外两个数分别为 b=2*n*n+2*n; c=b+1; 当a为大于等于4的偶数时,即a=2*n时,那么另外两个数分别为 b=n*n-1 c=n*n+1;
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/1083/A来源:牛客网 给出一个字符串s,你需要做的是统计s中子串”abc”的个数。子串的定义就是存在任意下标a<b<c,那么”s[a]s[b]s[c]”就构成s的一个子串。如”abc”的子串有”a”、”b”、”c”、”
阅读全文
摘要:output standard output output standard output output The only difference between easy and hard versions is the number of elements in the array. You ar
阅读全文
摘要:https://ac.nowcoder.com/acm/contest/879/B 链接:https://ac.nowcoder.com/acm/contest/879/B来源:牛客网 你在练习 dp,你每一次会有 p 的概率成功,1-p 的概率失败 求投 n 次后,至少有 k 次成功的概率 答案模
阅读全文
|