摘要:
题意:在n*m的地图上,一只虫子找地方睡觉,它一睡就会把自己拉伸到碰到砖块,问它睡觉地方种数。题解:两次sort,依次统计横着睡和竖着睡的种数。View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 struct data 6 { 7 int x,y; 8 }po[140000]; 9 bool comp_x(data a,data b)10 {11 if(a.x!=b.x)12 return a.x<b.x;13 e 阅读全文
posted @ 2012-10-16 20:06
tmeteorj
阅读(387)
评论(0)
推荐(0)
浙公网安备 33010602011771号