07 2021 档案
摘要:Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given
阅读全文
摘要:Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s
阅读全文
摘要:Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6,
阅读全文
摘要:A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key
阅读全文
摘要:To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same s
阅读全文
摘要:字符串反转: string s; reverse(s.begin(),s.end()); 单个数字转字符: string s=""; int n=9; s+=(n+'0'); cout<<s<<endl; 单个字符转数字: char c='9'; int n=c-'0'; cout<<c<<endl
阅读全文
摘要:The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s
阅读全文
摘要:Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-
阅读全文
摘要:Look-and-say sequence is a sequence of integers as the following: D, D1, D111, D113, D11231, D112213111, ... where D is in [0, 9] except 1. The (n+1)s
阅读全文
摘要:getline用来读入带空格的字符串 使用方式 getline(cin,st); 注意点: 若scanf或cin与getline一起使用,需要清空scanf或cin的缓冲内容 scanf("%d",&n); char c=getchar(); getline(cin,st); 其中c=getchar
阅读全文
摘要:A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years
阅读全文
摘要:People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzi
阅读全文
摘要:If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0 with simple c
阅读全文
摘要:To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords
阅读全文