判断一个数是否是质数(C++) 摘要:解题思路:注意事项:0和1不是质数参考代码:#include<iostream>using namespace std;bool check(int n)//检查这个数是否是质数,{ if (…… 题解列表 2023年03月25日 0 点赞 0 评论 457 浏览 评分:0.0
找最大公约数也是最小的公差 摘要:解题思路:因为是从等差数列取的几个数,所以这几个数一定是公差的几倍或者就是公差,为了满足n个数都能匹配,所以我们要选择最小公差注意事项:参考代码:n=int(input())a=list(map(in…… 题解列表 2023年03月25日 0 点赞 0 评论 449 浏览 评分:0.0
数组切分 动态规划 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N=1e5+10;in…… 题解列表 2023年03月25日 0 点赞 0 评论 549 浏览 评分:0.0
dfs+贪心解法 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int n,k;int dfs(int t){ if(t<=n) { …… 题解列表 2023年03月25日 0 点赞 0 评论 489 浏览 评分:0.0
求矩阵的两对角线上的元素之和python 摘要:解题思路:注意事项:参考代码:n = int(input())L = []s = 0for i in range(n): L.append(list(map(int,input().split(…… 题解列表 2023年03月25日 0 点赞 0 评论 419 浏览 评分:0.0
编写题解 2998: 电影票 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,b; while(~scanf("%d%d", &a, &b))printf("%d\n…… 题解列表 2023年03月25日 0 点赞 0 评论 454 浏览 评分:0.0
编写题解 1812: [编程基础]输入输出练习之输出图案 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ char c; c= getchar(); printf(" %c\n",c); pri…… 题解列表 2023年03月25日 0 点赞 0 评论 470 浏览 评分:0.0
编写题解 3000: 交换值 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a , b,c; scanf("%d %d",&a,&b); c=a; a=b;…… 题解列表 2023年03月25日 0 点赞 0 评论 466 浏览 评分:0.0
数列题解 简单易懂 摘要:解题思路:首先题目给出了数,并要我们求第10项开外的数,所以我们先把前四项附上值,也就是0次幂,1次幂,1次幂+1次幂,2次幂;在设置几个变量i,j,t,一个数组num[1000],其中i是要求的数组…… 题解列表 2023年03月25日 0 点赞 0 评论 494 浏览 评分:0.0
【贪心思想】巧克力 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h> #define int long long using namespace std; const int N = 1…… 题解列表 2023年03月25日 0 点赞 0 评论 606 浏览 评分:0.0