05 2019 档案

摘要:字符串哈希就是把一个字符串变成 long long 存起来, 然后对 1e9 + 7 取模, $b[i] = s[i]*{131}^{s.length() - 1 - i}$ ,sum[i] 存的是 b[i] 的前缀和 如果出现哈希冲突的话 我们需要采取的措施是算出这个字符串的两个哈希值然后进行比较 阅读全文
posted @ 2019-05-28 21:09 _Zlrrr 阅读(839) 评论(2) 推荐(0)
摘要:A. A pile of stones #include <bits/stdc++.h> using namespace std; int N; string s; int main() { scanf("%d", &N); cin >> s; int len = s.length(); int a 阅读全文
posted @ 2019-05-25 16:57 _Zlrrr 阅读(224) 评论(0) 推荐(0)
摘要:A. Eating Soup #include <bits/stdc++.h> using namespace std; int N, M; int main() { scanf("%d%d", &N, &M); int ans; if(N == M) ans = 0; else if(M == 0 阅读全文
posted @ 2019-05-22 22:04 _Zlrrr 阅读(204) 评论(0) 推荐(0)
摘要:A. Remainder #include <bits/stdc++.h> using namespace std; string s; int N, x, y; int main() { scanf("%d%d%d", &N, &x, &y); cin >> s; for(int i = 0; i 阅读全文
posted @ 2019-05-19 18:59 _Zlrrr 阅读(258) 评论(2) 推荐(0)
摘要:A. Hasan the lazy judge #include <bits/stdc++.h> using namespace std; inline int read(){ int x=0; bool f=0; char ch=getchar(); while (ch<'0' || '9'<ch 阅读全文
posted @ 2019-05-18 18:26 _Zlrrr 阅读(890) 评论(0) 推荐(0)
摘要:A. Zoning Restrictions Again You are planning to build housing on a street. There are nn spots available on the street on which you can build a house. 阅读全文
posted @ 2019-05-15 11:47 _Zlrrr 阅读(306) 评论(0) 推荐(0)
摘要:A.坐飞机 代码: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int n, t; int a[maxn], b[maxn]; int p[maxn]; int main() { scanf("%d 阅读全文
posted @ 2019-05-11 17:50 _Zlrrr 阅读(609) 评论(0) 推荐(1)
摘要:https://leetcode.com/problems/delete-duplicate-emails/ Write a SQL query to delete all duplicate email entries in a table named Person, keeping only u 阅读全文
posted @ 2019-05-11 15:24 _Zlrrr 阅读(127) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/classes-more-than-5-students/ There is a table courses with columns: student and class Please list out all classes which 阅读全文
posted @ 2019-05-11 15:22 _Zlrrr 阅读(144) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/second-highest-salary/ Write a SQL query to get the second highest salary from the Employee table. For example, given th 阅读全文
posted @ 2019-05-11 15:20 _Zlrrr 阅读(165) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/not-boring-movies/ X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a 阅读全文
posted @ 2019-05-11 15:18 _Zlrrr 阅读(155) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/swap-salary/ Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values ( 阅读全文
posted @ 2019-05-11 15:16 _Zlrrr 阅读(142) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/customers-who-never-order/ Suppose that a website contains two tables, the Customers table and the Orderstable. Write a 阅读全文
posted @ 2019-05-11 15:15 _Zlrrr 阅读(130) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/employees-earning-more-than-their-managers/ The Employee table holds all employees including their managers. Every emplo 阅读全文
posted @ 2019-05-11 15:13 _Zlrrr 阅读(242) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/big-countries/ There is a table World A country is big if it has an area of bigger than 3 million square km or a populat 阅读全文
posted @ 2019-05-11 15:10 _Zlrrr 阅读(159) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/duplicate-emails/ Write a SQL query to find all duplicate emails in a table named Person. For example, your query should 阅读全文
posted @ 2019-05-11 15:08 _Zlrrr 阅读(134) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/combine-two-tables/ Table: Person Table: Address Write a SQL query for a report that provides the following information 阅读全文
posted @ 2019-05-11 15:07 _Zlrrr 阅读(160) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/ Given two integers L and R, find the count of numbers in the range [L 阅读全文
posted @ 2019-05-11 14:58 _Zlrrr 阅读(183) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/partition-labels/ A string S of lowercase letters is given. We want to partition this string into as many parts as possi 阅读全文
posted @ 2019-05-11 14:56 _Zlrrr 阅读(147) 评论(0) 推荐(0)
摘要:A. Inscribed Figures The math faculty of Berland State University has suffered the sudden drop in the math skills of enrolling students. This year the 阅读全文
posted @ 2019-05-07 15:42 _Zlrrr 阅读(284) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/longest-increasing-subsequence/ Given an unsorted array of integers, find the length of longest increasing subsequence. 阅读全文
posted @ 2019-05-07 10:41 _Zlrrr 阅读(129) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/length-of-longest-fibonacci-subsequence/ A sequence X_1, X_2, ..., X_n is fibonacci-like if: n >= 3 X_i + X_{i+1} = X_{i 阅读全文
posted @ 2019-05-07 10:35 _Zlrrr 阅读(105) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/divisor-game/ Alice and Bob take turns playing a game, with Alice starting first. Initially, there is a number N on the 阅读全文
posted @ 2019-05-06 22:39 _Zlrrr 阅读(313) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/min-cost-climbing-stairs/ On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once yo 阅读全文
posted @ 2019-05-06 20:00 _Zlrrr 阅读(119) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/counting-bits/ Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the numbe 阅读全文
posted @ 2019-05-06 19:35 _Zlrrr 阅读(96) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/unique-binary-search-trees/ Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? 阅读全文
posted @ 2019-05-06 17:55 _Zlrrr 阅读(141) 评论(0) 推荐(0)
摘要:给字符串 s 然后 Q 次询问 字符串 t 是不是 s 的子序列 序列自动机是用来判断是否是子序列的算法 时间复杂度是 $O(len)$ nx[i][j] 数组存的是在 s 中第 i 位后面第一个 j 字母出现的位置 阅读全文
posted @ 2019-05-06 15:57 _Zlrrr 阅读(1232) 评论(1) 推荐(0)
摘要:A. Stock Arbitraging Welcome to Codeforces Stock Exchange! We're pretty limited now as we currently allow trading on one stock, Codeforces Ltd. We hop 阅读全文
posted @ 2019-05-06 12:57 _Zlrrr 阅读(341) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/2-keys-keyboard/ Initially on a notepad only one character 'A' is present. You can perform two operations on this notepa 阅读全文
posted @ 2019-05-06 10:08 _Zlrrr 阅读(136) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/student-attendance-record-ii/ Given a positive integer n, return the number of all possible attendance records with leng 阅读全文
posted @ 2019-05-06 09:45 _Zlrrr 阅读(117) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/student-attendance-record-i/ You are given a string representing an attendance record for a student. The record only con 阅读全文
posted @ 2019-05-05 19:41 _Zlrrr 阅读(120) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/longest-uncommon-subsequence-ii/ Given a list of strings, you need to find the longest uncommon subsequence among them. 阅读全文
posted @ 2019-05-05 19:35 _Zlrrr 阅读(181) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/696#question A 代码: #include <bits/stdc++.h> using namespace std; int T; char c[10] = {'N', 'o', 'w', 'C', 'o', 'd' 阅读全文
posted @ 2019-05-05 18:01 _Zlrrr 阅读(135) 评论(0) 推荐(0)
摘要:A.ORZZJQ 代码: #include <bits/stdc++.h> using namespace std; int main() { printf("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 阅读全文
posted @ 2019-05-01 19:28 _Zlrrr 阅读(226) 评论(0) 推荐(0)