Skip to content

Instantly share code, notes, and snippets.

@chuanying
Created August 18, 2013 03:40
Show Gist options
  • Save chuanying/6259792 to your computer and use it in GitHub Desktop.
Save chuanying/6259792 to your computer and use it in GitHub Desktop.
20130817 线下聚会总结

方勤 分享的题:

  1. Implement pop_heap http://en.cppreference.com/w/cpp/algorithm/pop_heap
  2. Zero one Knapsack https://github.com/soulmachine/acm-cheat-sheet/tree/master/C%2B%2B 的 10.5.1

贺峰 分享的题:

  1. FlatIterator iterator的iterator
  2. bool hasNext()
  3. T next();
  4. T remove();

cydu 分享的题:

  1. power sequence
  2. http://www.careercup.com/question?id=8591375
//Provide an implementation of the following interface: 
public interface Powers extends Iterator<Long> 
{ 
    /* Returns the next integer a in the arithmetic sequence of integers where 
     * * a = m^n, m > 1 n > 1, and m and n are both integers 
     * * Thus, the first few outputs will be 4, 8, 9, 16, 25, 27, 32, 36, etc. 
     * */ 

    public Long next(); 

    /* Resets the sequence to the beginning, such that the next call to next() 
     * * will return 4. 
     * */ 
    public void reset(); 
}
  1. sstring
  2. http://www.careercup.com/question?id=23869663
/*
A string is called sstring if it consists of lowercase english letters and no two of its consecutive characters are the same. 

You are given string s of length n. Calculate the number of sstrings of length that are not lexicographically greater than s. 
Input format 
The only line of input contains the string s. It's length is not greater than 100. 
All characters of input are lowercase english letters. 

Output format: 
Print the answer of test modulo 1009 to the only line of output. 

Sample input: 
bcd 

Sample output: 
653

Answer to "ccc" is 291
Answer to "ddd" is 941
Answer to "abbc" is 25
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment