摘要:
Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,... 阅读全文
2019年2月15日
摘要:
Description Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised 阅读全文
摘要:
Description There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei 阅读全文
摘要:
#include #include #include using namespace std; #define forn(i, n) for (int i = 0; i pii; const int N = 1000001; int n; set a[3]; int ans[N]; int main() { scanf("%d", &n); forn(i, n) ... 阅读全文
2019年2月13日
摘要:
以上是标准程序,以下是我的程序,相比之下我的程序太复杂了。因为没有用到next_permutation 阅读全文
摘要:
以上是标准程序,只用了155ms,而下面的我的代码用了904ms。差距还是很大的,仔细看,发现是细节的优化。 阅读全文
2019年2月11日
摘要:
Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti 阅读全文
摘要:
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a 阅读全文
摘要:
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet 阅读全文
摘要:
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Example 2: 阅读全文