小、pi孩
小、pi孩
全部文章
算法
Codeforce(14)
python学习(29)
动态规划(1)
快速幂 逆元(2)
数据结构(19)
最短路(1)
蓝桥杯(1)
计算机网络(2)
题解(2)
归档
标签
去牛客网
登录
/
注册
小、pi孩的博客
全部文章
/ 算法
(共26篇)
牛客小白月赛29(签到:A、E、G、H)
A 贪心,由于基地可以重复销毁,所以找出找出每架战机可轰炸基地的最大价值,排序之后贪心找一下即可 #include<iostream> #include<algorithm> using namespace std; const int N = 1e6 + 15; stru...
2020-11-15
2
444
分治法 ------ 金砖问题
金砖问题 一家公司的老板现在又一袋金砖,共n块,现进行分配。其中,最优秀的雇员得到其中最重的一块,最差的雇员得到其中最轻的一块。现假设有一台可以比较重量的仪器,老板希望用最少的比较次数找出其中最重和最轻的金砖。 /* 金砖问题:分治法 */ #include<iostream> #i...
2020-10-07
0
433
最近点对问题(暴力,分治)
最近点对问题 问题简述: 给你n个点,让你求出最近的两个点的距离。 第一行输入一个整数n,接下来n行,每行两个数,表示点的横纵坐标。 测试样例: 12 -1 3 -2 -2 1 -4 2 1 1 5 3 3 3 0 5 1 7 3 7 6 5 6 3 7 输出结果: 1.41421 Sol...
2020-10-07
0
529
Codeforces Round #626(Unusual Competitions)
题目: A bracketed sequence is called correct (regular) if by inserting “+” and “1” you can get a well-formed mathematical expression from it. For exampl...
2020-10-07
0
416
Educational Codeforces Round 83 (Rated for Div. 2)------Two Regular Polygons
题目: You are given two integers n and m (m<n). Consider a convex regular polygon of n vertices. Recall that a regular polygon is a polygon that is e...
2020-10-07
0
502
Educational Codeforces Round 83 (Rated for Div. 2)------Bogosort
题目: You are given an array a1,a2,…,an. Array is good if for each pair of indexes i<j the condition j−aj≠i−ai holds. Can you shuffle this array so t...
2020-10-07
0
551
Educational Codeforces Round 83 (Rated for Div. 2)------ Adding Powers
题目: Suppose you are performing the following algorithm. There is an array v1,v2,…,vn filled with zeroes at start. The following operation is applied t...
2020-10-07
0
416
Codeforces Round #628 (Div. 2)------CopyCopyCopyCopyCopy
题目: Ehab has an array a of length n. He has just enough free time to make a new array consisting of n copies of the old array, written back-to-back. W...
2020-10-07
0
450
Codeforces Round #628 (Div. 2)------Ehab and Path-etic MEXs
题目: You are given a tree consisting of n nodes. You want to write some labels on the tree’s edges such that the following conditions hold: Every label...
2020-10-07
0
394
Codeforces Round #628 (Div. 2)------Ehab the Xorcist
题目: Given 2 integers u and v, find the shortest array such that bitwise-xor of its elements is u, and the sum of its elements is v. Input The only li...
2020-10-07
0
390
首页
上一页
1
2
3
下一页
末页