hdu 1050 Moving Tables
生活随笔
收集整理的這篇文章主要介紹了
hdu 1050 Moving Tables
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
http://acm.hdu.edu.cn/showproblem.php?pid=1050
對與每個房間前面過道,操作一次標記一次,標記的最多的次數(shù)就是必須用的時間。
?
1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #define maxn 1000 5 using namespace std; 6 7 int f[maxn]; 8 int t,n; 9 10 int main() 11 { 12 scanf("%d",&t); 13 while(t--) 14 { 15 memset(f,0,sizeof(f)); 16 scanf("%d",&n); 17 for(int i=1; i<=n; i++) 18 { 19 int s,t; 20 scanf("%d%d",&s,&t); 21 s=(s-1)/2; 22 t=(t-1)/2; 23 if(s>t) swap(s,t); 24 for(int i=s; i<=t; i++) 25 { 26 f[i]++; 27 } 28 } 29 int max1=f[0]; 30 for(int i=0; i<=200; i++) 31 { 32 max1=max(max1,f[i]); 33 } 34 printf("%d\n",max1*10); 35 } 36 return 0; 37 } View Code?
轉(zhuǎn)載于:https://www.cnblogs.com/fanminghui/p/4014431.html
總結(jié)
以上是生活随笔為你收集整理的hdu 1050 Moving Tables的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android TextView Ed
- 下一篇: NSObject中的performSel