遍历一遍,遇到边界为奇数次时,格子在多边形内 偶数次时,在多边形外 #include<cstdio> #define REP(i, a, b) for(int i = (a); i < (b); i++) using namespace std; int main() { char s[105]; int n, m; while(~scanf("%d%d", &n, &m)) { int ans = 0, c = 0; REP(i, 0, n) { i…
Background from Wikipedia: “Set theory is a branch of mathematics created principally by the German mathematician Georg Cantor at the end of the 19th century. Initially controversial, set theory has come to play the role of a foundational theory in m…
思路:海伦公式, AC代码: #include<bits/stdc++.h> using namespace std; int main() { int n; scanf("%d",&n); double ha, hb, hc, a, b, c; while(~scanf("%lf %lf %lf",&ha,&hb,&hc)) { a = 2.0 / ha; b = 2.0 / hb ; c = 2.0 / hc; if(…
题目来源:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=45 SCUD Busters Background Some problems are difficult to solve but have a simplification that is easy to solve. Rather than…
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2119 11178 - Morley's Theorem Time limit: 3.000 seconds Problem DMorley’s TheoremInput: Standard Input Output: Standard Output Morley’s theorem stat…
Cellular Network Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVA 1456 A cellular network is a radio network made up of a number of cells each served by a base station located in the cell. The base sta…