摘要:
也是很直接的一道题,排序比较,无语的是又WA了一次,原因是输出格式"Case X: Y“我没看多输了个#号,好粗心啊。。。 代码如下:View Code 1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 5 const int maxn = 1000+10; 6 7 struct Soldier 8 { 9 int b,j;10 bool operator < (const Soldier& a) const{11 return j > a.j;12 }1 阅读全文
posted @ 2013-03-28 15:41
xiaobaibuhei
阅读(168)
评论(0)
推荐(0)
摘要:
很直接的一道题,排序比较就行了,不过还是超时了一次,因为一不小心写成死循环了。。。 代码如下: 1 #include 2 #include 3 using namespace std; 4 5 const int maxn = 20000+10; 6 int h[maxn], k[maxn]; 7 8 int main() 9 {10 #ifdef LOCAL11 freopen("in", "r", stdin);12 #endif13 int n, m;14 while(scanf("%d%d", &n, &m) 阅读全文
posted @ 2013-03-28 14:55
xiaobaibuhei
阅读(165)
评论(0)
推荐(0)

浙公网安备 33010602011771号