C. Ancient Berland Circus time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.…
C. Ancient Berland Circus 题目连接: http://www.codeforces.com/contest/1/problem/C Description Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different. In Ancient Berland arenas in circuses were s…
1C - Ancient Berland Circus 思路: 求出三角形外接圆: 然后找出三角形三条边在小数意义下的最大公约数; 然后n=pi*2/fgcd; 求出面积即可: 代码: #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define INF (1e9…
Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different. In Ancient Berland arenas in circuses were shaped as a regular (equiangular) polygon, the size and the number of angles could vary fro…
题目链接:https://codeforces.com/problemset/problem/1/C 题意:对于一个正多边形,只给出了其中三点的坐标,求这个多边形可能的最小面积,给出的三个点一定能够组成三角形. 思路:根据三角形三个顶点的坐标求得三角形的三边长a.b.c,海伦公式和正弦定理连理得半径R = abc / (4S),再求出外接圆圆心到三角形三个顶点组成的三个圆心角∠1.∠2.∠3的最大公约数作为正多边形的每一份三角形的内角,将所有三角形加起来即可.思路不难但是满满的细节orz,比如防…
传送门 题意 给出一正多边形三顶点的坐标,求此正多边形的面积最小值. 分析 为了叙述方便,定义正多边形的单位圆心角u为正多边形的某条边对其外接圆的圆心角(即外接圆的某条弦所对的圆心角). (1)多边形的边数未知,但其外接圆是确定的.多边形的外接圆即三个顶点所构成三角形的外接圆.面积最小即边数最少,单位圆心角最大. (2)设三角形某两边所对的圆心角为a1, a2 (expressed in radians),则最大单位圆心角为 u= gcd(a1, a2, 2PI-a1-a2). 思路 (1)三点…
题意 给出正多边形上三个点的坐标,求正多边形的最小面积 分析 先用三边长求出外接圆半径(海伦公式),再求出三边长对应的角度,再求出三个角度的gcd,最后答案即为\(S*2π/gcd\),S为gcd对应的三角形的面积 注意如果三个点在同一段半圆弧上,需要thec=2*pi-thea-theb,而不能直接用acos()函数求 数据卡精度,gcd要取0.001才行,其他不行 #include <bits/stdc++.h> using namespace std; #define ll long l…
CF第一场比赛的最后一题居然是计算几何. 这道题的考点也是比较多,所以来写一篇题解. 前置芝士 平面直角坐标系中两点距离公式:\(l=\sqrt{(X_1-X_2)^2+(Y_1-Y_2)^2}\) 海伦公式:在知道三边时用于计算三角形面积\(S=\sqrt{p(p-a)(p-b)(p-c)}\)(其中\(a,b,c\)为三角形三边,\(p=\frac{a+b+c}{2}\)) 外接圆半径公式:\(R=\frac{abc}{4S}\) 解三角形 (知道三边求角度): \(\cos B=\frac…
C. Ancient Berland Circus time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.…
描述 The Archeologists of the Current Millenium (ACM) now and then discover ancient artifacts located at vertices of regular polygons. The moving sand dunes of the desert render the excavations difficult and thus once three vertices of a polygon are di…