题解列表

筛选

1025: [编程入门]数组插入处理

摘要:解题思路:从后往前比较数组中的数值与目标数值的大小,若目标数值小于数组中的数,则数组中的数值向后移动,直到目标值大于数组中的数值,此时对应的数组中正好有一个空位,将目标值放入。然后遍历数组。注意事项:……

快速幂方法(需掌握)

摘要:参考代码:#include<bits/stdc++.h> using namespace std; #define int long long int fastPow(int a,int n,i……

2881: 图像相似度

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N=2e3;ll a……
优质题解

团伙(group) 并查集

摘要: #include using namespace std; int n,m; int o,p,q; int father[1001]; int……

逆天解法,包得吃的。

摘要:解题思路:一直交换,将后面的数换到前面。注意事项:参考代码:#include<stdio.h>int main(){ int a,i,j,b,c,arr[10]={0}; scanf("%d",&a)……

2820: 含k个3的数

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int i=0,x,y;    scanf("%d %d",&x,&y);    if(x%19==0) ……

题可以贪心做,人要看准了爱.

摘要:# 权重 = 价值 / 重量 就是先拿(价值/重量)权重最大的, 最后拿不下了就分割(权重*剩下背包重量)拿走就行了 ```cpp #include #define ULL unsign……

1177: 三角形

摘要:解题思路:注意事项:参考代码:t = int(input())for x in range(t):    n = int(input())    l = []    l = [ list(map(in……