2019年2月15日

摘要: 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,... 阅读全文
posted @ 2019-02-15 21:24 Albert67 阅读(133) 评论(0) 推荐(0) 编辑
 
摘要: Description Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised 阅读全文
posted @ 2019-02-15 20:54 Albert67 阅读(116) 评论(0) 推荐(0) 编辑
 
摘要: 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 阅读全文
posted @ 2019-02-15 17:18 Albert67 阅读(172) 评论(0) 推荐(0) 编辑
 
摘要: #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) ... 阅读全文
posted @ 2019-02-15 16:32 Albert67 阅读(112) 评论(0) 推荐(0) 编辑

2019年2月13日

摘要: 以上是标准程序,以下是我的程序,相比之下我的程序太复杂了。因为没有用到next_permutation 阅读全文
posted @ 2019-02-13 12:05 Albert67 阅读(167) 评论(0) 推荐(0) 编辑
 
摘要: 以上是标准程序,只用了155ms,而下面的我的代码用了904ms。差距还是很大的,仔细看,发现是细节的优化。 阅读全文
posted @ 2019-02-13 11:48 Albert67 阅读(141) 评论(0) 推荐(0) 编辑

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 阅读全文
posted @ 2019-02-11 12:02 Albert67 阅读(95) 评论(0) 推荐(0) 编辑
 
摘要: 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 阅读全文
posted @ 2019-02-11 12:01 Albert67 阅读(125) 评论(0) 推荐(0) 编辑
 
摘要: 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 阅读全文
posted @ 2019-02-11 10:49 Albert67 阅读(108) 评论(0) 推荐(0) 编辑
 
摘要: 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: 阅读全文
posted @ 2019-02-11 10:19 Albert67 阅读(115) 评论(0) 推荐(0) 编辑