
pat-a-二分
要认认真真
这个作者很懒,什么都没留下…
展开
-
1048. Find Coins (25)
点击打开链接 #include #include #include using namespace std; map ans; int coin[100010]; int main(){ freopen("in.txt","r",stdin); int n,p,cnt=0; scanf("%d %d",&n,&p); for(int i=0;i<n;i++){原创 2015-02-12 10:59:56 · 263 阅读 · 0 评论 -
1067. Sort with Swap(0,*) (25)
用map存超时了,换成结构体可能会省点时间,然后用二分 #include #include using namespace std; map mp; map::iterator it; void myswap(int &cnt){ map::iterator it=mp.begin(); while(it->second!=0){ cnt++; int tmp=it-原创 2015-02-14 10:40:32 · 342 阅读 · 0 评论