Kattis - triangle 【数学】】的更多相关文章

题意 求第N个迭代三角形 中 所有黑色三角形的周长的整数部分的位数 思路 该三角形的周长是 3^(n + 1)/ 2 ^ (n) 然后 可以用 long double 存下来 再求位数 就可以 AC 代码 #include <cstdio> #include <cstring> #include <ctype.h> #include <cstdlib> #include <cmath> #include <climits> #incl…
Triangle 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5914 Description Mr. Frog has n sticks, whose lengths are 1,2, 3⋯n respectively. Wallice is a bad man, so he does not want Mr. Frog to form a triangle with three of the sticks here. He decides…
KIDx's Triangle Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Submit Statistic Next Problem Problem Description One day, KIDx solved a math problem for middle students in seconds! And than he created this problem. N…
Triangle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0 Problem Description This is a simple question, give you a triangle, please divide the triangle into two p…
传送门 题意: 给出三个点的坐标,初始,这三个点可以构成一个三角形. 如果初始坐标可以构成直角三角形,输出"RIGNT". 如果某个点的 x或y 坐标移动一个单位后可以组成直角三角形,输出"ALMOST". 如果不能构成直角三角形,输出"NEITHER". 题解: 我的思路: 如何判断是否含有直角呢--向量. a,b,c 三点可以构成三条向量 ab,ab,bc(不考虑方向),如果存在某两条向量的点乘积为0,那么这两个向量垂直. AC代码: #in…
题面 题意:给你n,m,k,在你在(0,0)到(n,m)的矩形内,选3个格点(x,y都是整数),使得三角形面积为n*m/k,不能找到则输出-1 题解:由毕克定理知道,格点多边形的面积必为1/2的整数倍,所以首先n*m/k必须是1/2的整数倍,也就是2*n*m%k要等于0,不等于就输出-1 然后对于面积,我们知道底✖高*1/2=面积,a*b*1/2=n*m/k,我们很显然想到一种构造方法,(0,0),(0,a),(b,0); 有人就要问,会不会有一种,使得无法找到整数a,b,满足这种直角三角形点,…
A - A Very Easy Triangle Counting Game Time Limit:1000MS     Memory Limit:64000KB     64bit IO Format:%lld & %llu Submit Status Practice ACdream 1008 Description Speedcell and Shoutmon love triangles very much.One day,they are playing a game named “T…
Kattis - wheretolive [数学] Description Moving to a new town can be difficult. Finding a good place to live which is close to everything you're interested in is important. However, since you're a great programmer, you know that you can solve this probl…
Kattis - amsterdamdistance[数学] 题意 给出两个点 算出从第一个点到第二个点的最短距离,只不过这里不是直角坐标系, 是雷达图 思路 因为内圈的圆的路径要比外圈的小,所以我们要尽可能先往内圈走,加一个判断条件 走到哪里就好了 AC代码 #include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <deque> #…
题目传送门 /* 这道题花了好长时间AC,思路有,但是表达式少写了括号一直乱码,囧! 注意:a==0时要特判:) */ #include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #include <string> #include <cmath> using namespace std; ; const int INF = 0x3f3f3…