superman

聚精会神搞建设 一心一意谋发展
posts - 190, comments - 17, trackbacks - 0, articles - 0
   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

ZOJ 1029 - Moving Tables

Posted on 2008-03-28 16:15 superman 阅读(206) 评论(0)  编辑 收藏 引用 所属分类: ZOJ
 1 /* Accepted 1029 C++ 00:00.01 832K */
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int n;
 9     cin >> n;
10     while(cin >> n)
11     {
12         int s, t;
13         int count[201= {0};
14         for(int i = 0; i < n; i++)
15         {
16             cin >> s >> t;
17             if(s > t)
18             { s = s ^ t; t = s ^ t; s = s ^ t; }
19             s = (s + 1/ 2;
20             t = (t + 1/ 2;
21             for(int j = s; j <= t; j++)
22                 count[j]++;
23         }
24         int max = 0;
25         for(int i = 1; i <= 200; i++)
26             max >?= count[i];
27         cout << max * 10 << endl;
28     }
29     
30     return 0;
31 }
32 

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理