2021牛客暑期多校训练营1
作者:互联网
文章目录
- A-Alice and Bob
- B-Ball Dropping
- C-Cut the Tree
- D-Determine the Photo Position
- E-Escape along Water Pipe
- F-Find 3-friendly Integers
- G-Game of Swapping Numbers
- H-Hash Function
- I-Increasing Subsequence
- J-Journey among Railway Stations
- K-Knowledge Test about Match
A-Alice and Bob
题意:博弈题,每次一个人从一堆中取k个,同时从另一堆k*s(s>=0)个,(可以手工打表:D)
B-Ball Dropping
题意:一个球卡在一个直角等腰梯形内部,求卡着的高度。
求出公式高度H = r / cos(atan((a - b) / 2 / h)) - b / 2) * (h / ((a - b) / 2))
若2*r<d,则在底部
#include <bits/stdc++.h>
using namespace std;
int main(){
double r, a, b, h;
cin >> r >> a >> b >> h;
if(2*r < b){
cout << "Drop" << endl;
return 0;
}
else{
cout << "Stuck" << endl;
double temp = (a-b)/2;
double H = (r/cos(atan(temp/h))-b/2)*(h/temp);
printf("%.10lf\n", H);
}
return 0;
}
C-Cut the Tree
题意:给一个带点权的树,删去树上的一个点,最小化所有子树最长上升子序列的长度最大值。
N<=100000
线段树
D-Determine the Photo Position
E-Escape along Water Pipe
F-Find 3-friendly Integers
G-Game of Swapping Numbers
H-Hash Function
题意:给定n个不相同的数,找一个最小的模域,使得它们在这个模域下互不相同。n 50000。
考察内容:卷积、简单数论
I-Increasing Subsequence
J-Journey among Railway Stations
K-Knowledge Test about Match
标签:Hash,题意,多校,牛客,2021,Test,friendly,Match,cout 来源: https://blog.csdn.net/weixin_51671868/article/details/118861217