略有收获的bfs,使用了try_enqueue函数使得加入队列非常方便.性能理论上是一样的因为是inline? 还有就是左对齐是使用%-4d,相对于右对齐的%4d,还有右对齐前导零的%04d,自己试一下呗. #include<bits/stdc++.h> using namespace std; #define ll long long int n,m,sx,sy; ][]; struct QueueNode{ int x,y,t; QueueNode(,,):x(x),y(y),t(t){}
1124 Raffle for Weibo Followers (20 分) John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N followers who forwarded his post, and give away gifts