| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:又是一个C++ AC,G++RE的题目。。。难道STL的queue?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator