python编写题解 2793: 点和正方形的关系 摘要:解题思路:求x,y的区间注意事项:判断一个给定的点是否在这个正方形内参考代码:x, y = map(int, input().split()) if x >= -1 and x <= 1 and y…… 题解列表 2024年03月07日 0 点赞 0 评论 693 浏览 评分:0.0
最长不下降子序列的长度(动态dp——寻找前一项的最优解) 摘要:解题思路:利用动态规划,确定出到每一个数字的时候,所对应的dp[i]为多少dp[i]表示为在第i个数字时,前i个数字能组成的最长不下降子序列的长度例如给出一个数列: 1 3 5 2 8 7dp[4]=…… 题解列表 2024年03月07日 0 点赞 0 评论 530 浏览 评分:9.9
python编写题解 1039: [编程入门]宏定义之闰年判断 摘要:解题思路:普通年能被4整除且不能被100整除的为闰年,世纪年能被400整除的是闰年参考代码:def LEAP_YEAR(year): if year % 4 == 0 and year % …… 题解列表 2024年03月07日 0 点赞 0 评论 482 浏览 评分:0.0
python编写题解 2792: 三角形判断 摘要:解题思路:三角形的三边关系:任意两边之和大于第三边或者任意两边之差小于第三边。参考代码:a, b, c = map(int, input().split()) if a+b > c and a+c …… 题解列表 2024年03月07日 0 点赞 0 评论 417 浏览 评分:0.0
公共子序列 摘要:解题思路:注意事项:参考代码:def longestCommonSubsequence(X, Y): m, n = len(X), len(Y) dp = [[0] * (n+1) for…… 题解列表 2024年03月07日 0 点赞 0 评论 150 浏览 评分:0.0
移动玩具 dfs 摘要:广搜太麻烦了,深搜水了过去参考代码:#include<stdio.h>#include<math.h>#include<string.h>int book[10], x[10], y[10], ex[…… 题解列表 2024年03月07日 0 点赞 0 评论 251 浏览 评分:9.9
编写题解 3047: Crossing River 摘要:```python global times times=[] def crossingriver(p_list): p_list.sort()#顺序排列 time=0#…… 题解列表 2024年03月07日 0 点赞 0 评论 204 浏览 评分:0.0
C++老管家的忠诚(线段树做法) 摘要:区间查询,果断想到线段树,看了一下题解有很多用的st表,但感觉st表模板太难记了,线段树相对好记很多,还是线段树更香一点。树状数组也可以求最值但得改模板。参考代码:#include using nam…… 题解列表 2024年03月07日 0 点赞 0 评论 234 浏览 评分:9.9
小心:一系列整数可能会有相同的数 摘要:解题思路:注意事项:参考代码:#include <iostream>#include <algorithm>#include <vector>using namespace std;struct tr…… 题解列表 2024年03月07日 0 点赞 0 评论 226 浏览 评分:0.0
过滤多余的空格 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ string s; getline(cin,s); stri…… 题解列表 2024年03月07日 0 点赞 0 评论 320 浏览 评分:0.0