shunfurh 于 2017.09.16 21:48 提问

Problem H: Hills

Little Billy likes drawing with chalks of all colors. As a child of his age, all he can do is to draw straight lines. Today he has been told that hills are of the shape of triangles, and he brought out a lot of his works and tried to identify as many hills as he could. Being one of his best friends, you gladly joined his effort. However after working for a while you are desperate to find the huge number of sketches he has produced. You suggested this alternative plan �C to code up a program for him.

This sample figure only contains a single "hill"
Keep in mind that in Billy's pictures all the lines are connected, and no line will have an end point right on another line. We would only count the hills that are not cut by other lines.

Input Description

Standard input will contain multiple test cases. The first line of the input is a single integer T (1 <= T <= 10) which is the number of test cases. T test cases follow, each preceded by a single blank line.

Each test case starts with an integer N (1 < N <= 500), which is the number of lines on the picture. The next N lines contain a line segment's two end points. The coordinates are all integers (-10,000 < x, y < 10,000).

Output Description

Results should be directed to standard output. Start each case with "Case #:" on a single line, where # is the case number starting from 1. Two consecutive cases should be separated by a single blank line. No blank line should be produced after the last test case.

For each test case, print the number of hills on a single line.

Sample Input

3

3
-1 0 3 0
0 -1 0 3
-1 3 3 -1

4
-3 0 3 0
-3 -1 1 3
3 -1 -1 3
0 3 0 -1

6
-3 -2 3 -2
-2 -3 -2 3
-3 2 3 2
2 -3 2 3
-3 -3 3 3
1 -1 -1 1
Sample Output

Case 1:
1

Case 2:
2

Case 3:
0

1个回答

caozhy      2017.09.30 21:39

GREEN.HILLS.SOFTWARE.MULTI.FOR.MIPS.V4.0.7 破解文件
GREEN.HILLS.SOFTWARE.MULTI.FOR.MIPS.V4.0.7 破解文件 Green Hills C/C++ Compilers fully conform to ANSI/ISO industry standards, and include optional enforcement of MISRA C programming guidelines. A complete implementation of the C, C++, EC++, Ada 95 and FORTRAN libraries are included in compiler distributions. Full featured start-up code and libraries include automatic copy of data from ROM to RAM and system call emulation. Green Hills C/C++ Optimizing Compilers provide userselectable optimization options that trade-off code size vs. execution efficiency. In particular, for the MIPS16e and MIPS16 ASEs, benchmark tests have proven the effectiveness of the Green Hills Compilers in producing the smallest executable file from a given source base.
GreenHills MULTI: Getting Started
MULTI is a complete Integrated Development Environment (IDE) designed especially for embedded systems engineers to assist them in analyzing, editing, compiling, optimizing, and debugging embedded applications.
USACO-Section 1.3 Ski Course Design（枚举）

Problem H: 线性表的基本操作
Problem H: 线性表的基本操作 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 481  Solved: 265 [Submit][Status][Web Board] Description 线性表是一类重要的且基础的数据结构。请定义MyList类，来模拟针对线性表的插入、删除等操作： 1. 数据成员int *eleme
Green Hills MPC5744P Qorivva MCUs入门指南
Green Hills MPC5744P Qorivva MCUs入门指南.超级详细的green hills的使用资料
Problem H: STL——字符串排序
Problem H: STL——字符串排序 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 2872  Solved: 1234 [Submit][Status][Web Board] Description     对N个字符串排序。     0 Input     第一行读入N。     后面N行，每行一个字
Echo and Narcissus in Greek Mythology
Narci,comes from a myth of GreeceEcho was a beautiful nymph, fond of the woods and hills, where she devoted herself to woodland sports. She was a favorite of Artemis, an
HDU2601，An easy problem

Andrew Stankevich Contest 38 , J-Jackpot
J-Jackpot
Problem H: 稀疏矩阵的表示和运算 SDUSTOJ