编程介的小学生 2019-08-13 09:47 采纳率: 20.5%
浏览 106

打印桌面上的剩余的图书,用C语言来做

Problem Description

Ali’s room is full of books and he has never come up with a good way to arrange them. He just put them on the desk. But sometimes the books became unstable due to the gravity, and some might slide off the desk. He found it very annoying and decided to use a new method to put his books.
He bought some magic clips to stabilize the books. Once he put a book onto the desk, he will check if the book is steady. If it is, then he will use a clip to stabilize it and it will never slide or flip. If not, he will just pick up the book and throw it onto the floor and deal with it later.
But as he began to use the new method, he found it hard to decide whether a book is steady when put it on the desk. So he needs your help to determine that.
Assume that every book has the same thickness.
A book is steady means it will stay unmoved and horizontal even if given a small force.

Input
The input consists several testcases.
The first line contains the number of books N (1 <= N <= 2000).
The following N lines each contains four integers, x1,y1,x2,y2 (-103 <= x1, y1, x2, y2 <= 103), means that the i-th book is placed with lower-left-corner placed at x1,y1 and upper-right-corner placed at x2,y2 (if you look down from above). The book’s edge is always paralleled with the desk’s edge.

Output
Print one integer, the number of books that are remained on the desk.

Sample Input
3
0 0 2 2
-1 0 3 1
2 0 3 2

Sample Output
2

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 c语言,请帮蒟蒻看一个题
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)