锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美午夜宅男影院在线观看,亚洲伊人久久综合,欧美一区二粉嫩精品国产一线天http://www.shnenglu.com/patriking/category/15843.htmlzh-cnSun, 23 Jan 2011 04:20:58 GMTSun, 23 Jan 2011 04:20:58 GMT60STL 瀹瑰櫒Dequehttp://www.shnenglu.com/patriking/archive/2011/01/21/139060.htmlpatrikingpatrikingFri, 21 Jan 2011 14:25:00 GMThttp://www.shnenglu.com/patriking/archive/2011/01/21/139060.htmlhttp://www.shnenglu.com/patriking/comments/139060.htmlhttp://www.shnenglu.com/patriking/archive/2011/01/21/139060.html#Feedback0http://www.shnenglu.com/patriking/comments/commentRss/139060.htmlhttp://www.shnenglu.com/patriking/services/trackbacks/139060.htmltemplate <class T, template <class U> class Allocator = allocator>
class deque {
public:
// typedefs:
    typedef iterator;
    typedef const_iterator;
    typedef Allocator
<T>::pointer pointer;
    typedef Allocator
<T>::reference reference;
    typedef Allocator
<T>::const_reference const_reference;
    typedef size_type;
    typedef difference_type;
    typedef T value_type;
    typedef reverse_iterator;
    typedef const_reverse_iterator;
// allocation/deallocation:
    deque();
    deque(size_type n, 
const T& value = T());
    deque(
const deque<T, Allocator>& x);
    template 
<class InputIterator>
    deque(InputIterator first, InputIterator last);
    
~deque();
    deque
<T, Allocator>& operator=(const deque<T, Allocator>& x);
    
void swap(deque<T, Allocator>& x);
// accessors:
    iterator begin();
    const_iterator begin() 
const;
    iterator end();
    const_iterator end() 
const;
    reverse_iterator rbegin();
    const_reverse_iterator rbegin();
    reverse_iterator rend();
    const_reverse_iterator rend();
    size_type size() 
const;
    size_type max_size() 
const;
    
bool empty() const;
    reference 
operator[](size_type n);
    const_reference 
operator[](size_type n) const;
    reference front();
    const_reference front() 
const;
    reference back();
    const_reference back() 
const;
// insert/erase:
    void push_front(const T& x);
    
void push_back(const T& x);
    iterator insert(iterator position, 
const T& x = T());
    
void insert (iterator position, size_type n, const T& x);
    template 
<class InputIterator>
    
void insert (iterator position, InputIterator first, InputIterator last);
    
void pop_front();
    
void pop_back();
    
void erase(iterator position);
    
void erase(iterator first, iterator last);
};




patriking 2011-01-21 22:25 鍙戣〃璇勮
]]>
STL 瀹瑰櫒Listhttp://www.shnenglu.com/patriking/archive/2011/01/21/139059.htmlpatrikingpatrikingFri, 21 Jan 2011 14:15:00 GMThttp://www.shnenglu.com/patriking/archive/2011/01/21/139059.htmlhttp://www.shnenglu.com/patriking/comments/139059.htmlhttp://www.shnenglu.com/patriking/archive/2011/01/21/139059.html#Feedback0http://www.shnenglu.com/patriking/comments/commentRss/139059.htmlhttp://www.shnenglu.com/patriking/services/trackbacks/139059.htmltemplate <class T, template <class U>
class Allocator = allocator> class list 
{
public:
// typedefs:
    typedef iterator
    typedef const_iterator
    typedef Allocator
<T>::pointer pointer
    typedef Allocator
<T>::reference reference
    typedef Allocator
<T>::const_reference const_reference
    typedef size_type
    typedef difference_type
    typedef T value_type
    typedef reverse_iterator
    typedef const_reverse_iterator;
// allocation/deallocation:
    list()
    list(size_type n, 
const T& value = T())
    template 
<class InputIterator>
    list(InputIterator first, InputIterator last)
    list(
const list<T, Allocator>& x)
    
~list()
    list
<T, Allocator>& operator=(const list<T, Allocator>& x)
    
void swap(list<T, Allocator>& x);
// accessors:
    iterator begin()
    const_iterator begin() 
const
    iterator end()
    const_iterator end() 
const
    reverse_iterator rbegin()
    const_reverse_iterator rbegin();
    reverse_iterator rend();
    const_reverse_iterator rend();
    
bool empty() const;
    size_type size() 
const;
    size_type max_size() 
const;
    reference front();
    const_reference front() 
const;
    reference back();
    const_reference back() 
const;
// insert/erase:
    void push_front(const T& x);
    
void push_back(const T& x);
    iterator insert(iterator position, 
const T& x = T());
    
void insert(iterator position, size_type n, const T& x);
    template 
<class InputIterator>
    
void insert(iterator position, InputIterator first, InputIterator last);
    
void pop_front();
    
void pop_back();
    
void erase(iterator position);
    
void erase(iterator first, iterator last);
// special mutative operations on list:
    void splice(iterator position, list<T, Allocator>& x);
    
void splice(iterator position, list<T, Allocator>& x, iterator i);
    
void splice(iterator position, list<T, Allocator>& x,
    iterator first, iterator last);
    
void remove(const T& value);
    template 
<class Predicate> void remove_if(Predicate pred);
    
void unique();
    template 
<class BinaryPredicate> void unique(BinaryPredicate binary_pr
    
void merge(list<T, Allocator>& x);
    template 
<class Compare> void merge(list<T, Allocator>& x, Compare com
    
void reverse();
    
void sort();
    template 
<class Compare> void sort(Compare comp);
};



patriking 2011-01-21 22:15 鍙戣〃璇勮
]]>
鏈灝忓壊 ZOJ@2788http://www.shnenglu.com/patriking/archive/2011/01/20/138966.htmlpatrikingpatrikingThu, 20 Jan 2011 07:52:00 GMThttp://www.shnenglu.com/patriking/archive/2011/01/20/138966.htmlhttp://www.shnenglu.com/patriking/comments/138966.htmlhttp://www.shnenglu.com/patriking/archive/2011/01/20/138966.html#Feedback0http://www.shnenglu.com/patriking/comments/commentRss/138966.htmlhttp://www.shnenglu.com/patriking/services/trackbacks/138966.html浠庣洿瑙備笂鐪嬶紝鎴泦(S,T)鏄粠婧愮偣s鍒版眹鐐箃鐨勫繀緇忎箣璺紝濡傛灉璇ヨ礬鍫靛鍒欐祦浠巗鏃犳硶鍒拌揪t銆備簬鏄垜浠彲浠ュ緱鍒?span style="color: red;">鏈澶ф祦鏈灝忓壊瀹氱悊錛氫換鎰忎竴涓祦緗戠粶鐨勬渶澶ф祦閲忕瓑浜庤緗戠粶鐨勬渶灝忕殑鍓茬殑瀹歸噺銆?br>    鏈灝忓壊闂錛?a >ZOJ@2788
    棰樻剰錛氬湪涓鏍嬫ゼ涓湁鑻ュ共鎴塊棿錛屼竴涓埧闂存湁鑻ュ共鎵囬棬閫氬線鍒殑鎴塊棿錛岀幇鍦ㄦ埧闂翠腑鏈変竴涓猻ecure room銆傜敱浜庢湁涓浜涙晫浜哄凡緇忔綔鍏ユ煇涓浜涙埧闂達紝鐜板湪闂叧闂渶灝戠殑涓浜涢棬錛屼嬌寰楁晫浜轟滑鍒拌揪涓嶄簡secure room銆傚浜庝竴鎵囬棬榪為欰-B錛岃嫢鎺у埗闈㈡澘CP鍦ˋ鏂癸紝鍒欐繪槸鍙互浠嶢->B錛屼絾鏄嫢鍏充笂闂紝鍒橞涓嶈兘鍒拌揪A銆?br>    瑙f硶錛氭渶澶ф祦銆傞鍏堥氳繃floyd綆楁硶鍒ゆ柇鏄惁鏁屼漢鎬繪槸鍙互鍒拌揪secure room錛屽鏋滆兘鐩存帴杈撳嚭緇撴灉錛涘鏋滀笉鑳斤紝鍒欓氳繃鏈澶ф祦綆楁硶姹傝В鍗沖彲銆傚浜庝竴鎵囬棬A-B錛孋P鍦ˋ鏂瑰垯浠嶢榪炰竴鏉℃湁鍚戣竟鍒癇錛屽閲忎負鏃犵┓澶э紝浠嶣榪炰竴鏉¤竟鍒癆錛屽閲忎負1銆備袱涓埧闂翠箣闂村彲鑳芥湁澶氭墖闂紝杈圭殑瀹歸噺绱姞鍗沖彲銆傚鍔犱竴涓簮鐐癸紝浠庢簮鐐硅繛杈瑰埌鏈夋晫浜虹殑鎴塊棿錛屽閲忎負1銆傚鍥炬眰鏈澶ф祦鍗充負緇撴灉銆?br>浠g爜濡備笅錛?br>
// 2389732      2011-01-20 15:06:16        Accepted      2788      C++      0      184      *******
#include<cstdio>
#include
<algorithm>
#include
<cstring>
#define MAXN 22
#define inf 1000000
int map[MAXN][MAXN];
int flow[MAXN][MAXN];
int max_flow(int n,int mat[][MAXN],int source,int sink,int flow[][MAXN]){ 
    
int pre[MAXN],que[MAXN],p,q,t,i,j;
    
int d[MAXN];
    
int tmp;
    
if (source==sink) return inf; 
    
for (i=0;i<n;i++
        
for    (j=0;j<n;flow[i][j++]=0); 
    
for (;;){ 
        
for (i=0;i<n;pre[i++]=0); 
        pre[t
=source]=source+1,d[t]=inf; 
        
for (p=q=0;p<=q&&!pre[sink];t=que[p++]) 
               
for (i=0;i<n;i++
                
if (!pre[i]&&(tmp=mat[t][i]-flow[t][i])) 
                     pre[que[q
++]=i]=t+1,d[i]=d[t]<tmp?d[t]:tmp; 
                
else if (!pre[i]&&(tmp=flow[i][t])) 
                 pre[que[q
++]=i]=-t-1,d[i]=d[t]<tmp?d[t]:tmp; 
        
if (!pre[sink]) break
        
for (i=sink;i!=source;) 
               
if (pre[i]>0
                flow[pre[i]
-1][i]+=d[sink],i=pre[i]-1
               
else 
                flow[i][
-pre[i]-1]-=d[sink],i=-pre[i]-1
    } 
    tmp 
= 0;
    
for (i=0;i<n;tmp+=flow[source][i++]); 
    
return tmp; 
}
int main()
{
    
int T, n, m, k, y;
    
char str[3];
    
int d[MAXN];
    scanf(
"%d",&T);
    
while(T--)
    {
        scanf(
"%d%d",&m,&n);
        n
++;
        memset(map,
0,sizeof(map));
        memset(flow,
0,sizeof(flow));
        
for(int i = 1; i <= m; i++){
            scanf(
"%s %d",str, &k);
            d[i] 
= (strlen(str) == 1);
            
if(d[i])map[0][i] = inf;
            
for(int j = 0; j < k; j++){
                scanf(
"%d",&y);
                y
++;
                flow[i][y] 
= 1;
                map[i][y] 
+= inf;
                map[y][i] 
+= 1;
            }
        }
        
// Checking always exists a path to secure room. Output "PANIC ROOM BREACH"!
        for(k = 1; k <= m; k++)  
            
for(int i = 1; i <= m; i++)
                
for(int j = 1; j <= m; j++)
                    
if(flow[i][k]&&flow[k][j])
                        flow[i][j] 
= 1;
        
for(k = 1; k <= m && !(d[k] && flow[k][n]); k++);
        
if(k <= m)
            printf(
"PANIC ROOM BREACH\n");
        
else
            printf(
"%d\n", max_flow(m+1,map,0,n,flow));
    }
    
return 0;
}




patriking 2011-01-20 15:52 鍙戣〃璇勮
]]>
C璇█涓璵ath.h搴撲腑鐨勫父鐢ㄥ嚱鏁?/title><link>http://www.shnenglu.com/patriking/archive/2011/01/19/138914.html</link><dc:creator>patriking</dc:creator><author>patriking</author><pubDate>Wed, 19 Jan 2011 11:57:00 GMT</pubDate><guid>http://www.shnenglu.com/patriking/archive/2011/01/19/138914.html</guid><wfw:comment>http://www.shnenglu.com/patriking/comments/138914.html</wfw:comment><comments>http://www.shnenglu.com/patriking/archive/2011/01/19/138914.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/patriking/comments/commentRss/138914.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/patriking/services/trackbacks/138914.html</trackback:ping><description><![CDATA[int abs(int i) 榪斿洖鏁村瀷鍙傛暟i鐨勭粷瀵瑰?br>double cabs(struct complex znum) 榪斿洖澶嶆暟znum鐨勭粷瀵瑰?br>double fabs(double x) 榪斿洖鍙岀簿搴﹀弬鏁皒鐨勭粷瀵瑰?br>long labs(long n) 榪斿洖闀挎暣鍨嬪弬鏁皀鐨勭粷瀵瑰?br>double exp(double x) 榪斿洖鎸囨暟鍑芥暟e^x鐨勫?br>double frexp(double value,int *eptr) 榪斿洖value=x*2^n涓瓁鐨勫?0.5<=x<1),n瀛樿串鍦╡ptr涓?br>double ldexp(double value,int exp); 榪斿洖value*2^exp鐨勫?br>double log(double X) 榪斿洖logeX鐨勫?浠涓哄簳鐨勫鏁?<br>double log10(double x) 榪斿洖log10x鐨勫?浠?0涓哄簳鐨勫鏁?br>double pow(double x,double y) 榪斿洖x^y鐨勫?br>double pow10(int p) 榪斿洖10^p鐨勫?br>double sqrt(double x) 榪斿洖a,涓攁婊¤凍a*a=x,a>=0<br>double acos(double x) 榪斿洖x鐨勫弽浣欏雞cos^-1(x)鍊?x涓哄姬搴?br>double asin(double x) 榪斿洖x鐨勫弽姝e雞sin^-1(x)鍊?x涓哄姬搴?br>double atan(double x) 榪斿洖x鐨勫弽姝e垏tan^-1(x)鍊?x涓哄姬搴?br>double atan2(double y,double x) 榪斿洖y/x鐨勫弽姝e垏tan^-1(x)鍊?y鐨剎涓哄姬搴?br>double cos(double x) 榪斿洖x鐨勪綑寮os(x)鍊?x涓哄姬搴?br>double sin(double x) 榪斿洖x鐨勬寮in(x)鍊?x涓哄姬搴?br>double tan(double x) 榪斿洖x鐨勬鍒噒an(x)鍊?x涓哄姬搴?br>double cosh(double x) 榪斿洖x鐨勫弻鏇蹭綑寮osh(x)鍊?x涓哄姬搴?br>double sinh(double x) 榪斿洖x鐨勫弻鏇叉寮inh(x)鍊?x涓哄姬搴?br>double tanh(double x) 榪斿洖x鐨勫弻鏇叉鍒噒anh(x)鍊?x涓哄姬搴?br>double hypot(double x,double y) 榪斿洖鐩磋涓夎褰㈡枩杈圭殑闀垮害(z),x鍜寉涓虹洿瑙掕竟鐨勯暱搴?z^2=x^2+y^2<br>double ceil(double x) 榪斿洖涓嶅皬浜巟鐨勬渶灝忔暣鏁?br>double floor(double x) 榪斿洖涓嶅ぇ浜巟鐨勬渶澶ф暣鏁?br>void srand(unsigned seed) 鍒濆鍖栭殢鏈烘暟鍙戠敓鍣?br>int rand() 浜х敓涓涓殢鏈烘暟騫惰繑鍥炶繖涓暟<br>double poly(double x,int n,double c[])浠庡弬鏁頒駭鐢熶竴涓欏瑰紡<br>double modf(double value,double *iptr)灝嗗弻綺懼害鏁皏alue鍒嗚В鎴愭暣鏁伴儴鍒嗗拰灝忔暟閮ㄥ垎錛宨ptr涓烘暣鏁伴儴鍒嗭紝榪斿洖灝忔暟閮ㄥ垎<br>double fmod(double x,double y) 榪斿洖x/y鐨勪綑鏁?br>double atof(char *nptr) 灝嗗瓧絎︿覆nptr杞崲鎴愭誕鐐規暟騫惰繑鍥炶繖涓誕鐐規暟<br>double atoi(char *nptr) 灝嗗瓧絎︿覆nptr杞崲鎴愭暣鏁板茍榪斿洖榪欎釜鏁存暟<br>double atol(char *nptr) 灝嗗瓧絎︿覆nptr杞崲鎴愰暱鏁存暟騫惰繑鍥炶繖涓暣鏁?br>char *ecvt(double value,int ndigit,int *decpt,int *sign)灝嗘誕鐐規暟value杞崲鎴愬瓧絎︿覆騫惰繑鍥炶瀛楃涓?br>char *fcvt(double value,int ndigit,int *decpt,int *sign)灝嗘誕鐐規暟value杞崲鎴愬瓧絎︿覆騫惰繑鍥炶瀛楃涓?br>char *gcvt(double value,int ndigit,char *buf)灝嗘暟value杞崲鎴愬瓧絎︿覆騫跺瓨浜巄uf涓?騫惰繑鍥瀊uf鐨勬寚閽?br>char *ultoa(unsigned long value,char *string,int radix)灝嗘棤絎﹀彿鏁村瀷鏁皏alue杞崲鎴愬瓧絎︿覆騫惰繑鍥炶瀛楃涓?radix涓鴻漿鎹㈡椂鎵鐢ㄥ熀鏁?br>char *ltoa(long value,char *string,int radix)灝嗛暱鏁村瀷鏁皏alue杞崲鎴愬瓧絎︿覆騫惰繑鍥炶瀛楃涓?radix涓鴻漿鎹㈡椂鎵鐢ㄥ熀鏁?br>char *itoa(int value,char *string,int radix)灝嗘暣鏁皏alue杞崲鎴愬瓧絎︿覆瀛樺叆string,radix涓鴻漿鎹㈡椂鎵鐢ㄥ熀鏁?br>double atof(char *nptr) 灝嗗瓧絎︿覆nptr杞崲鎴愬弻綺懼害鏁?騫惰繑鍥炶繖涓暟,閿欒榪斿洖0<br>int atoi(char *nptr) 灝嗗瓧絎︿覆nptr杞崲鎴愭暣鍨嬫暟, 騫惰繑鍥炶繖涓暟,閿欒榪斿洖0<br>long atol(char *nptr) 灝嗗瓧絎︿覆nptr杞崲鎴愰暱鏁村瀷鏁?騫惰繑鍥炶繖涓暟,閿欒榪斿洖0<br>double strtod(char *str,char **endptr)灝嗗瓧絎︿覆str杞崲鎴愬弻綺懼害鏁?騫惰繑鍥炶繖涓暟,<br>long strtol(char *str,char **endptr,int base)灝嗗瓧絎︿覆str杞崲鎴愰暱鏁村瀷鏁?騫惰繑鍥炶繖涓暟,<br>int matherr(struct exception *e)鐢ㄦ埛淇敼鏁板閿欒榪斿洖淇℃伅鍑芥暟<br>double _matherr(_mexcep why,char *fun,double *arg1p,<br>double *arg2p,double retval)鐢ㄦ埛淇敼鏁板閿欒榪斿洖淇℃伅鍑芥暟<br>unsigned int _clear87() 娓呴櫎嫻偣鐘舵佸瓧騫惰繑鍥炲師鏉ョ殑嫻偣鐘舵?br>void _fpreset()閲嶆柊鍒濅嬌鍖栨誕鐐規暟瀛︾▼搴忓寘<br>unsigned int _status87() 榪斿洖嫻偣鐘舵佸瓧 <br> <img src ="http://www.shnenglu.com/patriking/aggbug/138914.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/patriking/" target="_blank">patriking</a> 2011-01-19 19:57 <a href="http://www.shnenglu.com/patriking/archive/2011/01/19/138914.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>STL涔婼et operation on sorted structureshttp://www.shnenglu.com/patriking/archive/2011/01/18/138722.htmlpatrikingpatrikingTue, 18 Jan 2011 02:17:00 GMThttp://www.shnenglu.com/patriking/archive/2011/01/18/138722.htmlhttp://www.shnenglu.com/patriking/comments/138722.htmlhttp://www.shnenglu.com/patriking/archive/2011/01/18/138722.html#Feedback0http://www.shnenglu.com/patriking/comments/commentRss/138722.htmlhttp://www.shnenglu.com/patriking/services/trackbacks/138722.html鍖呭惈錛氬鏋淸first2,last2)鍖呭惈鍦╗first1,last1)涓紝榪斿洖true,鍚﹀垯榪斿洖false銆?br>bool includes(InputIterator1 first1, InputIterator1 last1,InputIterator2 first2, InputIterator2 last2)
bool includes(InputIterator1 first1, InputIterator1 last1,InputIterator2 first2, InputIterator2 last2, Compare comp)

鍚堝茍錛氬悎騫禰first1,last1)涓嶽first2,last2)涓や釜闆嗗悎銆?br>OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result)
OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)

姹備氦闆嗭細姹俒first1,last1)涓嶽first2,last2)涓や釜闆嗗悎鐨勪氦闆嗐?
OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result)
OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)

姹傚樊錛氭眰鍦╗first1,last1)涓紝鑰屼笉鍦╗first2,last2)鐨勫厓绱犻泦鍚堛?
OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result)
OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)

姹傚縐板樊錛氫袱涓泦鍚堜箣鍜岄泦 鍑忓幓 涓や釜闆嗗悎涔嬩氦闆嗐?
OutputIterator set_symmetric difference(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result)
OutputIterator set_symmetric difference(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)

#include<iostream>
#include
<algorithm>
#include
<vector>
#include
<iterator>
using namespace std;
void init(vector<int>& v, int a, int b)
{
    v.clear();
    
for(int i = a; i <= b; i++){
        v.push_back(i);
    }
}
int main()
{
    vector
<int>v1, v2;
    vector
<int>::iterator itr;
    cout 
<< "Includes operator:" << endl;
    init(v1,
1,5);
    init(v2,
1,8);
    cout 
<< "Vector v1: ";
    copy(v1.begin(),v1.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "Vector v2: ";
    copy(v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "v2 is in v1 ? " << (includes(v1.begin(),v1.end(),v2.begin(),v2.end()) ? "yes" : "no"<< endl;
    cout 
<< "v1 is in v2 ? " << (includes(v2.begin(),v2.end(),v1.begin(),v1.end()) ? "yes" : "no"<< endl;
    
    cout 
<< endl;
    init(v1,
1,5);
    init(v2,
3,8);
    cout 
<< "Vector v1: ";
    copy(v1.begin(),v1.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "Vector v2: ";
    copy(v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "set_union operator on v1,v2: ";
    set_union(v1.begin(),v1.end(),v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    
    init(v1,
1,5);
    init(v2,
3,8);
    cout 
<< "Vector v1: ";
    copy(v1.begin(),v1.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "Vector v2: ";
    copy(v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "set_intersecion operator on v1,v2: ";
    set_intersection(v1.begin(),v1.end(),v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    
    init(v1,
1,5);
    init(v2,
3,8);
    cout 
<< "Vector v1: ";
    copy(v1.begin(),v1.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "Vector v2: ";
    copy(v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "set_difference operator, v1 to v2: ";
    set_difference(v1.begin(),v1.end(),v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "set_difference operator, v2 to v1: ";
    set_difference(v2.begin(),v2.end(),v1.begin(),v1.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    
    init(v1,
1,5);
    init(v2,
3,8);
    cout 
<< "Vector v1: ";
    copy(v1.begin(),v1.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "Vector v2: ";
    copy(v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "set_symmetric_difference operator, v1 to v2: ";
    set_symmetric_difference(v1.begin(),v1.end(),v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "set_symmetric_difference operator, v2 to v1: ";
    set_symmetric_difference(v2.begin(),v2.end(),v1.begin(),v1.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    
return 0;
}

Includes operator:
Vector v1: 
1 2 3 4 5
Vector v2: 
1 2 3 4 5 6 7 8
v2 
is in v1 ? no
v1 
is in v2 ? yes

Vector v1: 
1 2 3 4 5
Vector v2: 
3 4 5 6 7 8
set_union 
operator on v1,v2: 1 2 3 4 5 6 7 8

Vector v1: 
1 2 3 4 5
Vector v2: 
3 4 5 6 7 8
set_intersecion 
operator on v1,v2: 3 4 5

Vector v1: 
1 2 3 4 5
Vector v2: 
3 4 5 6 7 8
set_difference 
operator, v1 to v2: 1 2
set_difference 
operator, v2 to v1: 6 7 8

Vector v1: 
1 2 3 4 5
Vector v2: 
3 4 5 6 7 8
set_symmetric_difference 
operator, v1 to v2: 1 2 6 7 8
set_symmetric_difference 
operator, v2 to v1: 1 2 6 7 8



patriking 2011-01-18 10:17 鍙戣〃璇勮
]]>
STL涔婱ergehttp://www.shnenglu.com/patriking/archive/2011/01/17/138692.htmlpatrikingpatrikingMon, 17 Jan 2011 13:35:00 GMThttp://www.shnenglu.com/patriking/archive/2011/01/17/138692.htmlhttp://www.shnenglu.com/patriking/comments/138692.htmlhttp://www.shnenglu.com/patriking/archive/2011/01/17/138692.html#Feedback0http://www.shnenglu.com/patriking/comments/commentRss/138692.htmlhttp://www.shnenglu.com/patriking/services/trackbacks/138692.htmlmerge鍚堝茍涓や釜鏈夊簭鐨剆equence錛岄粯璁や負<姣旇緝錛屽彲鑷畾涔夋瘮杈冨嚱鏁癱omp錛岀粨鏋滀繚瀛樺湪[result, result + (last1 - first1) + (last2 - first2)) 涓傚嚱鏁板畾涔夊涓嬶細
OutputIterator merge (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result)
OutputIterator merge (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)

inplace_merge鍚堝茍涓涓腑鍓嶅悗涓ゆ鍒嗗埆鏈夊簭鐨勫簭鍒楋紝鍗砙first,middle)涓嶽middle,last)鍒嗗埆鏈夊簭錛屽悎騫惰繖涓や釜瀛愬簭鍒楋紝騫舵妸緇撴灉淇濆瓨鍦╗first,last錛変腑銆?br>inplace_merge (BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last);
inplace_merge (BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp);

#include<string>
#include
<algorithm>
#include
<iostream>
#include
<iterator>
#include
<vector>
using namespace std;
int main()
{
    vector
<int>v1;
    vector
<int>v2;
    vector
<int>v3;
    vector
<int>::iterator vecitr;
    
for(int i = 1; i <= 10; i++){
        v1.push_back(i
%7);
        v2.push_back(i
%4);
    }
    sort(v1.begin(),v1.end());
    cout 
<< "Fisrt vecter: ";
    copy(v1.begin(),v1.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    sort(v2.begin(),v2.end());
    cout 
<< "Second vecter: ";
    copy(v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    cout 
<< "Merge this two vecter: ";
    merge(v1.begin(),v1.end(),v2.begin(),v2.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    
for(int i = 1; i <= 10; i++){
        v3.push_back(i
%7);
    }
    sort(v3.begin(),v3.end());
    
int x = v3.size();
    
for(int i = 1; i <= 10; i++){
        v3.push_back(i
%4);
    }
    vecitr 
= v3.begin();
    advance(vecitr,x);
    sort(vecitr,v3.end());
    cout 
<< "Third vecter: ";
    copy(v3.begin(),v3.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    cout 
<< "inplace_Merge third vecter: ";
    inplace_merge(v3.begin(),vecitr,v3.end());
    copy(v3.begin(),v3.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    return 0;
}
Fisrt vecter: 0 1 1 2 2 3 3 4 5 6

Second vecter: 
0 0 1 1 1 2 2 2 3 3

Merge 
this two vecter: 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 4 5 6

Third vecter: 
0 1 1 2 2 3 3 4 5 6 0 0 1 1 1 2 2 2 3 3

inplace_Merge third vecter: 
0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 4 5 6




patriking 2011-01-17 21:35 鍙戣〃璇勮
]]>
STL涔婤inary searchhttp://www.shnenglu.com/patriking/archive/2011/01/16/138617.htmlpatrikingpatrikingSun, 16 Jan 2011 14:40:00 GMThttp://www.shnenglu.com/patriking/archive/2011/01/16/138617.htmlhttp://www.shnenglu.com/patriking/comments/138617.htmlhttp://www.shnenglu.com/patriking/archive/2011/01/16/138617.html#Feedback0http://www.shnenglu.com/patriking/comments/commentRss/138617.htmlhttp://www.shnenglu.com/patriking/services/trackbacks/138617.html
ForwardIterator lower_bound (ForwardIterator first,ForwardIterator last, const T& value)
ForwardIterator lower_bound (ForwardIterator first,ForwardIterator last, const T& value, Compare comp)
//鏌ユ壘鏈榪滅殑涓涓猧terator i錛?浣垮緱[first,i)閲岄潰鐨勪換鎰忎竴涓猧terator j錛屾湁 *j < value or comp(*j,value)==true.

ForwardIterator upper_bound (ForwardIterator first,ForwardIterator last, const T& value)
ForwardIterator upper_bound (ForwardIterator first,ForwardIterator last, const T& value, Compare comp)
//鏌ユ壘鏈榪滅殑涓涓猧terator i錛?浣垮緱[first,i)閲岄潰鐨勪換鎰忎竴涓猧terator j錛屾湁 !(*j < value) or comp(*j,value)==false.

pair equal_range(ForwardIterator first, ForwardIterator last, const T& value)
pair equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp)
//鏌ユ壘鏈澶х殑subrange[i,j)錛屼嬌寰椾換鎰忎竴涓猧terator in [i,j)婊¤凍!(*k<value) && !(value<*k) or comp(*k,value)==false && comp(value,*k)==false.

bool binary_search (ForwardIterator first, ForwardIterator last, const T& value)
bool binary_search (ForwardIterator first, ForwardIterator last, const T& value, Compare comp)
// 鏌ユ壘鏄惁鍦╗first,last)涓瓨鍦╥terator i,婊¤凍 !(*i<value) && !(value<*i) or comp(*i,value)==false && comp(value,*i)==false
// 瀛樺湪鍒欒繑鍥瀟rue,鍚﹀垯榪斿洖false. 

#include<algorithm>
#include
<iostream>
#include
<vector>
#include
<iterator>
using namespace std;
int main()
{
    vector
<int>v;
    vector
<int>::iterator itr;
    pair
< vector<int>::iterator, vector<int>::iterator >vecpair;
    
    
for(int i = 1; i <= 20; i++){
        v.push_back(i
%6);
    }
    sort(v.begin(),v.end());
    cout 
<< "array: " << endl << "    ";
    copy(v.begin(),v.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    
    
//lower_bound
    cout << "lower_bound function, value = 3:" << endl; 
    itr 
= lower_bound(v.begin(),v.end(),3);
    cout 
<< "    [first, itr) = ";
    copy(v.begin(),itr,ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "    [itr, last) = ";
    copy(itr,v.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    
    
// upper_bound
    cout << "upper_bound function, value = 3:" << endl; 
    itr 
= upper_bound(v.begin(),v.end(),3);
    cout 
<< "    [first, itr) = ";
    copy(v.begin(),itr,ostream_iterator
<int>(cout," "));
    cout 
<< endl;
    cout 
<< "    [itr, last) = ";
    copy(itr,v.end(),ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    
    
// equal_range
    cout << "equal_range function, value = 3:" << endl; 
    vecpair 
= equal_range(v.begin(),v.end(),3);
    
    cout 
<< "    [vecpair->first, vecpair->second) = ";
    copy(vecpair.first, vecpair.second, ostream_iterator
<int>(cout," "));
    cout 
<< endl << endl;
    
    
//binary_search, value = 3
    cout << "binary_search function, value = 3:" << endl;
    cout 
<< "3 is " << (binary_search(v.begin(),v.end(),3? "":"not "<< "in array." << endl;
    cout 
<< endl;
    
    
//binary_search, value = 6
    cout << "binary_search function, value = 6:" << endl;
    cout 
<< "6 is " << (binary_search(v.begin(),v.end(),6? "":"not "<< "in array." << endl;
    cout 
<< endl;
    
    
return 0;    
}
 

array:
    
0 0 0 1 1 1 1 2 2 2 2 3 3 3 4 4 4 5 5 5
lower_bound function, value 
= 3:
    [first, itr) 
= 0 0 0 1 1 1 1 2 2 2 2
    [itr, last) 
= 3 3 3 4 4 4 5 5 5

upper_bound function, value 
= 3:
    [first, itr) 
= 0 0 0 1 1 1 1 2 2 2 2 3 3 3
    [itr, last) 
= 4 4 4 5 5 5

equal_range function, value 
= 3:
    [vecpair
->first, vecpair->second) = 3 3 3

binary_search function, value 
= 3:
3 is in array.

binary_search function, value 
= 6:
6 is not in array.




patriking 2011-01-16 22:40 鍙戣〃璇勮
]]>
sscanf and scanf鍑芥暟%[]鐢ㄦ硶http://www.shnenglu.com/patriking/archive/2011/01/15/138579.htmlpatrikingpatrikingSat, 15 Jan 2011 11:54:00 GMThttp://www.shnenglu.com/patriking/archive/2011/01/15/138579.htmlhttp://www.shnenglu.com/patriking/comments/138579.htmlhttp://www.shnenglu.com/patriking/archive/2011/01/15/138579.html#Feedback1http://www.shnenglu.com/patriking/comments/commentRss/138579.htmlhttp://www.shnenglu.com/patriking/services/trackbacks/138579.html    %[]琛ㄧず瑕佽鍏ヤ竴涓瓧絎﹂泦鍚? 濡傛灉[鍚庨潰絎竴涓瓧絎︽槸”^”錛屽垯琛ㄧず鍙嶆剰鎬濄?br>    []鍐呯殑瀛楃涓插彲浠ユ槸1鎴栨洿澶氬瓧絎︾粍鎴愩傜┖瀛楃闆嗭紙%[]錛夋槸榪濆弽瑙勫畾鐨勶紝鍙鑷翠笉鍙鐭ョ殑緇撴灉錛屽悓鏍?[^]涔熸槸榪濆弽瑙勫畾鐨勩?br>渚嬪: %[a-z]璇誨彇鍦╝-z涔嬮棿鐨勫瓧絎︿覆錛屽鏋滀笉鍦ㄦ涔嬪墠鍒欏仠姝紝濡?br>          char s[]="hello, my friend” ; // 娉ㄦ剰: ,閫楀彿鍦ㄤ笉 a-z涔嬮棿
          sscanf( s, “%[a-z]”, string ) ; // string=hello
      %[^a-z] 璇誨彇涓嶅湪a-z涔嬮棿鐨勫瓧絎︿覆錛屽鏋滅鍒癮-z涔嬮棿鐨勫瓧絎﹀垯鍋滄錛屽
          char s[]="HELLOkitty” ; // 娉ㄦ剰: ,閫楀彿鍦ㄤ笉 a-z涔嬮棿
          sscanf( s, “%[^a-z]”, string ) ; // string=HELLO
      %*[^=] 鍓嶉潰甯?* 鍙瘋〃紺轟笉淇濆瓨鍙橀噺,璺寵繃絎﹀悎鏉′歡鐨勫瓧絎︿覆銆?br>          char s[]="notepad=1.0.0.1001" ;
          char szfilename [32] = "" ;
          int i = sscanf( s, "%*[^=]", szfilename ) ; // szfilename=NULL,鍥犱負娌′繚瀛?br>          int i = sscanf( s, "%*[^=]=%s", szfilename ) ; // szfilename=1.0.0.1001



patriking 2011-01-15 19:54 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美制服丝袜| 国产精品中文字幕欧美| 翔田千里一区二区| 久久香蕉国产线看观看网| 亚洲免费视频观看| 欧美激情综合五月色丁香小说| 久久成人国产精品| 欧美午夜在线| 日韩视频在线免费观看| 91久久精品国产91久久性色tv| 欧美一二三区在线观看| 亚洲欧美激情在线视频| 欧美日韩国产首页在线观看| 欧美激情视频一区二区三区在线播放| 国产日本亚洲高清| 亚洲综合成人在线| 亚洲欧美视频在线观看视频| 欧美日韩另类国产亚洲欧美一级| 欧美成人自拍视频| **性色生活片久久毛片| 久久久久久午夜| 美女啪啪无遮挡免费久久网站| 国产欧美日韩精品一区| 亚洲一区亚洲| 欧美永久精品| 国产综合精品| 久久精品一区中文字幕| 久久夜色撩人精品| 一区视频在线播放| 久久噜噜亚洲综合| 欧美成人激情视频| 亚洲欧洲日本一区二区三区| 免费精品视频| 日韩视频永久免费观看| 亚洲欧美国产一区二区三区| 国产精品黄色| 性欧美18~19sex高清播放| 久久高清国产| 亚洲大片av| 欧美—级a级欧美特级ar全黄| 亚洲精品美女在线| 日韩一区二区免费看| 国产精品白丝黑袜喷水久久久| 午夜视频在线观看一区二区三区| 久久国产精品免费一区| 亚洲第一精品夜夜躁人人爽| 久久综合伊人77777| 亚洲三级影片| 久久爱91午夜羞羞| 亚洲成色www8888| 欧美激情欧美激情在线五月| 日韩亚洲欧美一区| 欧美在线综合视频| 亚洲国产91| 欧美日韩免费看| 久久国产手机看片| 亚洲国产女人aaa毛片在线| 亚洲网址在线| 国内成人精品视频| 欧美极品影院| 午夜伦理片一区| 亚洲黑丝在线| 欧美专区第一页| 日韩视频免费在线观看| 国产香蕉久久精品综合网| 欧美成人按摩| 欧美一区二区三区在线播放| 亚洲国产精品久久久久秋霞蜜臀| 午夜精品短视频| 91久久国产自产拍夜夜嗨| 国产精品日韩专区| 欧美韩日高清| 久久精品一区蜜桃臀影院| 99re热这里只有精品视频| 久久综合999| 欧美亚洲网站| 亚洲午夜国产成人av电影男同| 国产在线日韩| 国产精品视频一| 欧美韩日一区| 农村妇女精品| 久久国产欧美日韩精品| 亚洲一区视频| 一区二区动漫| 亚洲日本欧美天堂| 奶水喷射视频一区| 久久久久久久久久久成人| 亚洲一区二区3| 99国内精品久久| 亚洲国产一区在线观看| 含羞草久久爱69一区| 国产精品欧美风情| 欧美视频不卡中文| 欧美激情精品久久久久久蜜臀| 久久精品道一区二区三区| 亚洲欧美成人综合| 亚洲午夜精品久久久久久浪潮| 亚洲精品久久久久久久久久久久久 | 亚洲国产美女| 国产真实久久| 国产一区二区三区奇米久涩| 国产精品日本精品| 欧美亚一区二区| 欧美色精品在线视频| 欧美喷潮久久久xxxxx| 欧美国产欧美亚洲国产日韩mv天天看完整 | 欧美日本精品一区二区三区| 看片网站欧美日韩| 久久免费视频在线| 久久久精品tv| 久久另类ts人妖一区二区| 久久久久综合一区二区三区| 久久高清一区| 久久美女性网| 欧美国产日韩在线| 欧美日韩国产天堂| 欧美午夜三级| 国产酒店精品激情| 激情一区二区三区| 亚洲国产欧美精品| 亚洲精品久久嫩草网站秘色 | 亚洲天堂av电影| 亚洲欧美日韩在线不卡| 欧美一激情一区二区三区| 久久精品国产清高在天天线 | 国产欧美日韩在线| 韩国精品在线观看| 亚洲国产影院| 亚洲永久免费精品| 久久精品国产91精品亚洲| 麻豆久久婷婷| 亚洲精品综合| 午夜国产精品视频免费体验区| 欧美一区二区高清| 老妇喷水一区二区三区| 欧美激情一区| 国产亚洲一区二区三区在线观看 | 欧美高清视频在线观看| 欧美日韩成人在线观看| 国产精品一二一区| 亚洲国产va精品久久久不卡综合| 艳女tv在线观看国产一区| 亚洲女人天堂成人av在线| 麻豆成人91精品二区三区| 亚洲人成啪啪网站| 先锋影音久久久| 欧美国产日本在线| 国产一区在线播放| 日韩视频在线免费| 欧美伊久线香蕉线新在线| 亚洲国产成人精品女人久久久| 一区二区三区视频在线观看| 久久久久久久久久久久久久一区 | 久久尤物视频| 国产精品久久久久久久第一福利| 在线观看成人av电影| 午夜精品久久久| 亚洲国产欧美日韩| 久久精品国产亚洲aⅴ| 欧美日韩高清一区| 亚洲国产精品va在线看黑人动漫 | 国产欧美日韩精品a在线观看| 亚洲激情视频在线播放| 亚洲欧美影院| 亚洲精品日韩久久| 免费不卡中文字幕视频| 国产欧美丝祙| 亚洲一区二区免费看| 欧美第一黄网免费网站| 欧美在线视频一区二区| 国产精品久久久久久久久久ktv| 亚洲国产成人午夜在线一区 | 欧美国产在线电影| 欧美影院久久久| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲国内精品| 你懂的国产精品永久在线| 香蕉精品999视频一区二区| 欧美午夜精品久久久久久久| 日韩亚洲欧美高清| 亚洲国产另类久久精品| 久久综合狠狠综合久久激情| 国产一区二区三区无遮挡| 亚洲欧美在线另类| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 国产精品综合视频| 午夜精品久久久久影视| 一个色综合av| 国产精品久久9| 亚洲免费在线| 亚洲一区欧美一区| 国产精品亚发布| 欧美亚洲网站| 欧美一区二区大片| 国内成人自拍视频| 欧美成人在线网站| 欧美激情在线观看| 亚洲小视频在线| 亚洲综合首页| 黄色亚洲网站|