python-摆花摆花 摘要:解题思路:注意事项:参考代码:def f(n,m): num = [0] + [int(i) for i in input().strip().split()] dp = …… 题解列表 2022年04月06日 0 点赞 0 评论 548 浏览 评分:9.9
复杂度O(n)版题解 摘要:解题思路:主要利用前缀和思想,一部分值要减掉,一部分值要加上。注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int m[27][3];//…… 题解列表 2022年04月06日 0 点赞 0 评论 768 浏览 评分:9.9
最简单(自定义函数之字符串反转) 摘要:解题思路:注意事项:参考代码:错误思路:对字符串进行降序正确思路:对字符串进行逆序操作def person(n): print(n[::-1]) n=input() person(n)…… 题解列表 2022年04月06日 0 点赞 0 评论 630 浏览 评分:9.9
迭代思想 17行代码 完成 蛇行矩阵 摘要:解题思路:1.用外层循环 控制行数(此时需要n0 来保留原输入的n); 2.内层的第一个循环 通过n 控制列数 并 输出(t为输出的值,观察样本输出序列,每次需要自增 i+1 + j+1); 3.…… 题解列表 2022年04月06日 0 点赞 0 评论 545 浏览 评分:9.9
Dijskra(迪杰斯特拉)最短路径算法 摘要:#include<bits/stdc++.h>using namespace std;int n, s, dis[55], scan[55], node[55][55], num, cur, inf …… 题解列表 2022年04月06日 0 点赞 0 评论 556 浏览 评分:9.9
非常容易理解(自定义函数之字符串连接) 摘要:解题思路:注意事项:参考代码:def person(h,s):#输入的参数 h=h+s#拼接字符串 print(h) #类型都为字符串 h=input() s=inp…… 题解列表 2022年04月06日 0 点赞 0 评论 1117 浏览 评分:9.9
自定义函数之数字分离(适合新手理解) 摘要:解题思路:注意事项:参考代码:注意事项:一定要注意格式 和审题def person_pratice(n): for i in str(n): print(int(i),en…… 题解列表 2022年04月06日 0 点赞 0 评论 516 浏览 评分:9.9
[编程入门]带参数宏定义练习(暴力解法,超级容易学会) 摘要:解题思路:注意事项:参考代码思路:直接一行输入多个并逆序即为交换x=list(map(int,input().split())) x=x[::-1] for i in x: print(…… 题解列表 2022年04月06日 0 点赞 0 评论 860 浏览 评分:9.9
Sine之舞 1、递归 2、for循环 摘要:1、递归#include <stdio.h> int a=0; int n,b; int A(int b) { //A3=sin(1–sin(2+sin(3))) a++; if(…… 题解列表 2022年04月06日 0 点赞 0 评论 806 浏览 评分:9.9
日期问题(附带详细分析与拓展) 摘要:### 注意事项 不知道各位看官是否和我一样,02/03/04 答案是 2002-03-04 2004-02-03 2004-03-02 所以以为是直接在年份前面补充20 比如第一个…… 题解列表 2022年04月06日 0 点赞 0 评论 563 浏览 评分:9.9