链接:https://ac.nowcoder.com/acm/problem/15185 答案来自一位不认识的学者 不是本人打的 #include<iostream> #include<cmath> #include<iomanip> using namespace std; int main() ...
分类:
其他好文 时间:
2020-04-21 00:12:02
阅读次数:
61
字符串hash+二分答案 "Palindrome poj 3974" 求一个字符串的最长回文子串。 因为在学字符串hash,所以这里用二分答案和字符串hash来做,复杂度是O(N log N),据说manacher算法可以在O(N)解决这个问题,但是我还没学哈哈哈哈以后补吧 题解:枚举回文子串的中心 ...
分类:
其他好文 时间:
2020-04-20 21:27:55
阅读次数:
60
1,什么是Mybatis?Mybatis的优缺点? MyBatis 是支持普通 SQL查询,存储过程和高级映射的优秀持久层框架。MyBatis 消除了几乎所有的JDBC代码和参数的手工设置以及结果集的检索。MyBatis 使用简单的 XML或注解用于配置和原始映射,将接口和 Java 的POJOs( ...
分类:
编程语言 时间:
2020-04-20 14:05:39
阅读次数:
94
I I HDU 3466Proud Merchants(贪心+01背包) Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in ...
分类:
其他好文 时间:
2020-04-20 14:04:37
阅读次数:
77
A题: 代码: include include include include include include include include include include using namespace std; typedef long long ll; const int MAXN=1e5+ ...
分类:
其他好文 时间:
2020-04-19 11:13:10
阅读次数:
48
题目描述: 解法:贪心,每次减去<k的最大斐波那契数 class Solution: def findMinFibonacciNumbers(self, k: int) -> int: fib = [1, 1] while fib[-1] <= k: fib.append(fib[-1] + fib ...
分类:
其他好文 时间:
2020-04-19 10:56:29
阅读次数:
56
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ag ...
分类:
其他好文 时间:
2020-04-19 10:48:26
阅读次数:
73
这是一道贪心题目,贪心的思路就是将代价从小到大排序,然后不断选取最小的代价(需要满足此关系的两朵云彩没有联通,否则直接跳过选下一个)。 满足此关系的两朵云彩是否联通可以用并查集来处理。 代码: c: #include<stdio.h> struct node{ int a,b,p;//a,b连接的云 ...
分类:
其他好文 时间:
2020-04-19 10:44:20
阅读次数:
49
你的团队中有 n 个人,每个人有一个能力值 ai?,现在需要选择若干个人组成一个团队去参加比赛,由于比赛的规则限制,一个团队里面任意两个人能力的差值必须要小于等于 k ,为了让更多的人有参加比赛的机会,你最多能选择多少个人参加比赛? 链接:https://ac.nowcoder.com/acm/co ...
分类:
其他好文 时间:
2020-04-19 00:50:00
阅读次数:
117
比赛链接:https://ac.nowcoder.com/acm/contest/5278 A - 组队比赛 题意 将四个数分为两个和,使二者相差尽量小。 思路 枚举其中一个和的情况。 代码 #include <bits/stdc++.h> using namespace std; int main ...
分类:
其他好文 时间:
2020-04-18 17:11:44
阅读次数:
91