摘要:
# include <bits/stdc++.h> # define MAX (100000+10) //# define DB # define pt puts("") using namespace std; struct node{ int a, b; node(int x, int y):a 阅读全文
摘要:
Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all 阅读全文
摘要:
Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one 阅读全文
摘要:
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elev 阅读全文
摘要:
Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1≤i≤j≤K. T 阅读全文
摘要:
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door 阅读全文
摘要:
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat 阅读全文
摘要:
1.gets() 读入一行, 以换行作为分隔符(回车), 能读入tab将其当做一个字符, 能读入空格当做一个字符, 如果直接回车能读入一个空串。 如果前面有别的字符,从最后一个未被读入的位置开始读入(不一定是行首),如果要行首可以while(getchar()!='\n');跳过换行前的字符。 2. 阅读全文
摘要:
signed main() { int a[11]={1000, 1,8, 1,4, 6,1, 3,2, 9,0}; sort(a+1,a+1+10); int len = unique(a+1, a + 1 + 10) - a -1; for(int i=1;i<1 + len;++i) cout<<a[i]<<" "; puts(""); cout<<len<<endl; return 0; 阅读全文
摘要:
#include // std::cout #include // std::lower_bound, std::upper_bound, std::sort #include // std::vector int main () { int myints[] = {10,20,30,30,20,10,10,20}; std::vector v(myin... 阅读全文