题解列表

筛选

第一个pyAC 五行秒杀

摘要:解题思路:注意事项:参考代码:n=int(input())while len(str(n))!=1:       x=sum(list(map(int,str(n))))        n=x……

寻找矩阵最值

摘要:解题思路:第一层循环赋值,同时比大小,第二层找到选好的值输出类似的nxn矩阵都可以这么做注意事项:i+1,j+1输出的下标和找到的不一样参考代码:#include<iostream> #includ……

纯签到题,str.count直接秒了

摘要:解题思路:注意事项:参考代码:n=int(input())cnt=0for i in range(1,n+1):    t=str(i)    if t.count(&#39;2&#39;)>0 or……

datetime判断日期合理性即可

摘要:解题思路:注意事项:参考代码:from datetime import datetimedef isValidTime(y,m,d):    try:        t=datetime(y,m,d)……

動態內存申請

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>//malloc函數的頭文件void mycpy(const char *sou,char *goa……

nxn矩阵的两对角线上的元素之和

摘要:解题思路:对于nxn级矩阵求对角线的和,实际是选取主对角线及下标和为n-1的数组和同时减去中心数组的值注意事项:参考代码:#include<iostream> using namespace std……

题解 1095: The 3n + 1 problem

摘要:解题思路:注意事项:还得先比较输入的两个数的大小!!!参考代码#include<stdio.h> int main() {     int a,b,m,n,j,temp;     int su……

C++递归求解

摘要:解题思路:注意事项:参考代码:#include <iostream>#include <vector>using namespace std;vector<int> f[100050];int dfs……