I'm sorryTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total Submission (s): 3538 Accepted Submission (s): 1489
Problem description Very sorry, originally excitedly engaged in a practice game, because I am not prepared enough, there are a lot of data errors, now here for a simple topic:
A few days ago on the internet to find ACM data, see a high School Olympiad question, is disjoint curve segment cutting plane problem, I have sent to the forum, and LXJ has got a conclusion, here is not
More than that, here's a similar and simpler question:
Assuming that there are n points on the plane, and that at least 2 curved segments of each point are connected to it, that is, each curve is closed, at the same time, we stipulate:
1) All the curved segments do not intersect;
2) It is possible to have more than one curve segment at random between two points.
Suppose we know that these line segments cut the plane into m parts, can you tell how many curved segments a joint has?
Input data including n and m,n=0,m=0 indicate the end of the input and do not process.
All input data is within a 32-bit integer range.
The output outputs the corresponding number of segments.
Sample Input
3 20 0
Sample Output
3
Authorlcy
SOURCEACM Summer Training Team Practice (a) knowledge points: Euler's formula: number of polygons + fixed-point number -2= edges. The code is as follows:
#include <stdio.h>int main () {__int64 n,m;//Although the input data is within the integer range of 32, the addition may be out of range, with 64-bit __int64 or long long while (~SCANF ( "%i64d%i64d", &n,&m),! (!n&&!m)) {printf ("%i64d\n", n+m-2);//simple Euler formula, number of polygons + fixed-point number -2= edges. }return 0;}
HDU 1418 (sorry) (Euler formula, fixed-point number, number of edges, number of polygons) (water problem)