摘要:
You are given nn integer numbers a1,a2,…,ana1,a2,…,an. Consider graph on nn nodes, in which nodes ii, jj (i≠ji≠j) are connected if and only if, aiaiAN 阅读全文
摘要:
You are given a line of nn colored squares in a row, numbered from 11 to nn from left to right. The ii-th square initially has the color cici. Let's s 阅读全文
摘要:
The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. Given any two nodes in a bin 阅读全文
摘要:
Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly 阅读全文
摘要:
Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt 阅读全文
摘要:
Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhi 阅读全文
摘要:
P is a permutation of the integers from 1 to N(index starting from 1). Here is the code of Bubble Sort in C++. for(int i=1;i<=N;++i) for(int j=N,t;j>i 阅读全文