摘要:
题目链接http://www.dotcpp.com/oj/contest1480.html 问题 B: 汉诺塔 #include<iostream> using namespace std; int n; void move(int a,int n,int b){ //将编号为n的木块 从a移到b 阅读全文
摘要:
题目链接https://ac.nowcoder.com/acm/contest/393#question A-字符串 这题只要找两个字符串公共最长子串就好了,O(n) 其中LCS=LCP=最长公共子串 #include<iostream> #include<stack> #include<cstdi 阅读全文
摘要:
题目链接http://contest-hunter.org:83/contest/0x00%E3%80%8C%E5%9F%BA%E6%9C%AC%E7%AE%97%E6%B3%95%E3%80%8D%E4%BE%8B%E9%A2%98/0301%20%E9%80%92%E5%BD%92%E5%AE% 阅读全文
摘要:
lowbit(n) 定义为非负整数 n 在二进制表示下 "最低位的 1 及其后边所有的 0"构成的数值。例如:n=10 的二进制表示为 1010 ,则lowbit(n) = 2 =10(二进制)。 lowbit(n) 公式:lowbit(n) = n & (-n) lowbit 运算配合 Hash 阅读全文
摘要:
题目链接http://contest-hunter.org:83/contest/0x00%E3%80%8C%E5%9F%BA%E6%9C%AC%E7%AE%97%E6%B3%95%E3%80%8D%E4%BE%8B%E9%A2%98/0103%20%E6%9C%80%E7%9F%ADHamilto 阅读全文
摘要:
题目链接http://contest-hunter.org:83/contest/0x00%E3%80%8C%E5%9F%BA%E6%9C%AC%E7%AE%97%E6%B3%95%E3%80%8D%E4%BE%8B%E9%A2%98/0102%2064%E4%BD%8D%E6%95%B4%E6%9 阅读全文
摘要:
题目链接http://contest-hunter.org:83/contest/0x00%E3%80%8C%E5%9F%BA%E6%9C%AC%E7%AE%97%E6%B3%95%E3%80%8D%E4%BE%8B%E9%A2%98/0101%20a%5Eb 数据有点问题,题目明确说了a,b,p大 阅读全文
摘要:
题目链接http://www.dotcpp.com/oj/problem1097.html ac代码: #include<iostream> using namespace std; int n; int a[110][110]; int main() { while (cin >> n){ int 阅读全文
摘要:
题目链接http://www.dotcpp.com/oj/problem1095.html?sid=760729&lang=1#editor 这个题目只是一道简单的模拟题,为啥我还要贴出来,因为这输出实在是太坑了,留个纪念 ac代码: #include<iostream> #include<vect 阅读全文
摘要:
这是我第一次在Leetcode上写题,说实话,第一次不是太适应 题目链接https://leetcode-cn.com/problems/two-sum/ 没想到这么个"简单题"的解法还能这么巧妙 一、暴力 复杂度O(n^2) 用时320ms,内存消耗9.4MB class Solution { p 阅读全文