标签:
Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Description
Input
Output
Sample Input
Sample Output
1 #include "cstdio" 2 3 struct tv 4 { 5 int beg; 6 int end; 7 }; 8 tv v[100]; 9 void tbegin(int t) 10 { 11 for (int i=0;i<t;i++) 12 scanf ("%d%d",&v[i].beg,&v[i].end); 13 } 14 void tx(int t) 15 { 16 int n=0,u=0,b; 17 for (int i=0;i<t;i++) 18 { 19 if (v[i].beg >= n) 20 { 21 b = v[i].end; 22 for (int j=i+1;j<t;j++) 23 { 24 if (v[j].beg >= n && v[j].end < b) 25 b = v[j].end; 26 } 27 u++; 28 n = b; 29 } 30 } 31 printf ("%d\n",u); 32 } 33 void px(int t) 34 { 35 tv x; 36 for (int i=0;i<t;i++) 37 for (int j=i;j<t;j++) 38 { 39 if (v[i].beg > v[j].beg) 40 { 41 x = v[i]; 42 v[i] = v[j]; 43 v[j] = x; 44 } 45 } 46 } 47 int main() 48 { 49 int t; 50 while (scanf ("%d",&t) && t) 51 { 52 tbegin(t); 53 px(t); 54 tx(t); 55 } 56 return 0; 57 }
暑假集训(2)第七弹 -----今年暑假不AC(hdu2037)
标签:
原文地址:http://www.cnblogs.com/huas-zlw/p/5697063.html