
几何
ZzzzGgggHhhh
这个作者很懒,什么都没留下…
展开
-
第 45 届国际大学生程序设计竞赛(ICPC)亚洲区域赛(上海)——I
Sky Garden #include<bits/stdc++.h> #define pi acos(-1.0) using namespace std; typedef long long ll; typedef double db; const int N=1005; db anlen[N]; int main() { int n,m; scanf("%d %d",&n,&m); db ans=0; int dian=m*2; int a=floor((1.0/p原创 2020-12-18 16:47:47 · 791 阅读 · 1 评论 -
2019 TCO Regional Event 现场热身游戏
Simple Billiards 题目链接 二维 xOy 平面内放置着一张 w×h 的长方形台球桌。球桌左下角的坐标是 (0,0)、右上角的坐标是 (w,h),并且每个角都开有一个球袋。 现在有一颗初始位于球桌内部 (x,y) 位置的球沿 Ox 逆时针旋转 r 度的方向被击出。当球碰到球桌边缘(但不是球桌的角)时,会遵循反射定律反弹回去,然后在球桌上继续前进直到碰到球桌的某个角并落入球袋。你需要判断这颗球最终是否会落入某个球袋中。 为了简化问题,球和每个球袋都会被看作是一个点,球能落袋当且仅当某时刻球的位置原创 2020-12-11 22:22:27 · 223 阅读 · 0 评论 -
2019ICPC南京——K
Triangle 题目链接 给定一个三角形,和三角形上一个点,求三角形上另一个点,两点将三角形分成面积均等的两份。 利用比值的思想,即可求解。 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef double db; ll x1,x2,x3,y11,y2,y3,x,y; bool check(ll x1,ll y11,ll x2,ll y2,ll x,ll y) {//判断给定点是不是在三角形原创 2020-12-10 17:58:38 · 369 阅读 · 0 评论 -
2020牛客暑期多校训练营(第二场)——K
Keyboard Free 链接:https://ac.nowcoder.com/acm/contest/5667/K 来源:牛客网 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 Given three concentric circles whose radiuses are r_1, r_2, r_3r1,r2,r3 respectively, and {A,B,C}A,B,C are原创 2020-07-17 16:29:20 · 301 阅读 · 0 评论 -
2020牛客暑期多校训练营(第二场)——B
题意:给定n个点,让更多的点落在同一个经过原点(0,0)的圆上,求出最多的点数。 题解:固定一个点,再遍历一遍其他点,加上原点,每次三个点,可以确定一个圆,手动推出圆心坐标的公式,然后遍历出有多少个点落在这个圆上,求出最大值即可。 推圆心坐标:两点确定一条直线,三点求出两条直线,再求出这两条直线的垂线,再求出两条直线的交点即可。 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<.原创 2020-07-13 22:58:58 · 347 阅读 · 0 评论 -
2019-icpc西安邀请赛-C
Angel’s Journey “Miyane!” This day Hana asks Miyako for help again. Hana plays the part of angel on the stage show of the cultural festival, and she is going to look for her human friend, Hinata. So she must find the shortest path to Hinata’s house. The ar原创 2020-07-06 23:23:51 · 441 阅读 · 0 评论 -
牛客小白月赛20A
斐波那契 题解: 快速幂就过了 #include<stdio.h> #include<string.h> using namespace std; const int N=2; typedef long long ll; struct Matrix { ll matrix[N][N]; }; const int mod = 1e9 + 7; void init(Mat...原创 2019-12-22 18:42:16 · 183 阅读 · 0 评论