Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:又是一个C++ AC,G++RE的题目。。。难道STL的queue?

Posted by xyf at 2010-06-23 11:34:53 on Problem 1201
In Reply To:又是一个C++ AC,G++RE的题目。。。难道STL的queue? Posted by:yzhw at 2010-02-17 23:02:38
queue自己写……

struct queue{
	int head,tail,size,q[1000000];
	void clear(){
		head=1;
		tail=size=0;	
	}
	void push(int k){
		++size;
		q[++tail]=k;
	}
	int get(){
		--size;
		return q[head++];
	}
	int temp(){
		if (!size) return 1;
		return 0;
	}
}q

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator