摘要: # 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 阅读全文
posted @ 2021-04-11 01:26 Unknown_Island 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-07-18 23:34 Unknown_Island 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-07-18 20:45 Unknown_Island 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-07-18 18:56 Unknown_Island 阅读(80) 评论(0) 推荐(0) 编辑
摘要: Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​, ..., N​j​​ } where 1≤i≤j≤K. T 阅读全文
posted @ 2020-07-18 18:55 Unknown_Island 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-07-18 18:53 Unknown_Island 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-07-18 18:51 Unknown_Island 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 1.gets() 读入一行, 以换行作为分隔符(回车), 能读入tab将其当做一个字符, 能读入空格当做一个字符, 如果直接回车能读入一个空串。 如果前面有别的字符,从最后一个未被读入的位置开始读入(不一定是行首),如果要行首可以while(getchar()!='\n');跳过换行前的字符。 2. 阅读全文
posted @ 2019-11-17 17:05 Unknown_Island 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 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; 阅读全文
posted @ 2019-10-16 09:32 Unknown_Island 阅读(82) 评论(0) 推荐(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... 阅读全文
posted @ 2019-10-15 16:23 Unknown_Island 阅读(84) 评论(0) 推荐(0) 编辑