摘要:
unique_ptr 原型 ` template class unique_ptr; template class unique_ptr; ` 以下英文抄自https://en.cppreference.com/w/cpp/memory/unique_ptr。面试复习备份。 具体解释 std::un 阅读全文
摘要:
functor仿函数 重载函数调用(),可当作函数使用。 跟函数指针相比,能保存状态(即struct的private变量) https://stackoverflow.com/questions/356950/what are c functors and their uses ` template 阅读全文
摘要:
Round A https://codejam.withgoogle.com/codejam/contest/9234486/dashboard A 题意 给一个数,每次可以加一或减一,求最少操作次数,使得最后这个数的十进制表示中每个位都是偶数。 数据范围 Limits 1 ≤ T ≤ 100. S 阅读全文
摘要:
C K th Substring Problem Statement You are given a string s. Among the different substrings of s, print the K th lexicographically smallest one. A sub 阅读全文
摘要:
A Zero Sum Ranges Problem Statement We have an integer sequence A, whose length is N. Find the number of the non empty contiguous subsequences of A wh 阅读全文
摘要:
C Many Medians "source" Time limit : 2sec / Memory limit : 256MB Problem Statement When l is an odd number, the median of l numbers a1,a2,…,al is the 阅读全文
摘要:
最近准备考一下PAT,感觉PAT甲级的题目比较适合练习快速ac能力,基本上看完每题都能有思路,但总不能一次过,需要好好练练。 1001 A+B Format (20) Calculate a + b and output the sum in standard format that is, the 阅读全文
摘要:
A 共同富裕 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一个数组A1, A2, ... AN,每次操作可以从中选定一个元素Ai,把除了Ai之外的所有元素都加1。 问最少几次操作可以实现“共同富裕”,即数组中所有元素都相等。 例如对于[1, 1, 1, 2, 3 阅读全文