Chef and The Right Triangles The Chef is given a list of N triangles. Each triangle is identfied by the coordinates of its three corners in the 2-D cartesian plane. His job is to figure out how many of the given triangles are right triangles. A right…
优雅的暴力. 设三个点为 \((i,j,k)\),则有 \(6\) 个未知数即 \(x_i,x_j,x_k,y_i,y_j,y_k\).又因为有 \(2\) 条关于这 \(6\) 个未知数的方程 \(ij=jk,ij=ik\),所以一定能通过枚举其中的 \(4\) 个量来求解,时间复杂度 \(O(n^4)\). 而这个 \(O(n^4)\) 的暴力是肉眼可见的跑不满( 考虑先枚举点 \(i\),则有以下四种情况: 解得 \(x=a,y=a-b\). 其中,\(a,x>0,0\le b,y \le…
Fighting for Triangles 题目连接: http://codeforces.com/gym/100015/attachments Description Andy and Ralph are playing a two-player game on a triangular board that looks like the following: 1 2 3 4 5 7 8 6 9 10 11 13 14 16 17 12 15 18 At each turn, a playe…
C. Love Triangles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/553/problem/C Description There are many anime that are about "love triangles": Alice loves Bob, and Charlie loves Bob as well, but Alice hates Charlie.…
D. Vanya and Triangles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/problem/D Description Vanya got bored and he painted n distinct points on the plane. After that he connected all the points pairwise and saw that as…
Right triangles with integer coordinates The points P (x1, y1) and Q (x2, y2) are plotted at integer co-ordinates and are joined to the origin, O(0,0), to form ΔOPQ. There are exactly fourteen triangles containing a right angle that can be formed whe…
Alyona and Triangles 题目连接: http://acm.hust.edu.cn/vjudge/contest/121333#problem/J Description You are given n points with integer coordinates on the plane. Points are given in a way such that there is no triangle, formed by any three of these n point…
Little Zu Chongzhi's Triangles Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 743    Accepted Submission(s): 399 Problem Description Zu Chongzhi (429–500) was a prominent Chinese mathematicia…
Description There has been considerable archeological work on the ancient Myacm culture. Many artifacts have been found in what have been called power fields: a fairly small area, less than 100 meters square where there are from four to fifteen tall…
How Many Triangles 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5784 Description Alice has n points in two-dimensional plane. She wants to know how many different acute triangles they can form. Two triangles are considered different if they differ…