1.裁剪刀

public class Main{ public static void main(String[] args){
System.out.println(4+(20-1)+20*(22-1)); }

2.根据表格规律寻找数字

import java.util.Scanner; public class Main { public static void
main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt();
int[] nums=new int[n]; for(int x=0;x<n;x++) { nums[x]=sc.nextInt(); }
sc.close(); int sum=0; for(int i=0;i<n-1;i++) { for(int j=i+1;j<n;j++) {
sum=sum+nums[i]*nums[j]; } } System.out.println(sum); } }
4.寻找k

import java.util.Scanner; public class Main{ public int gcd(int a,int b){
if(a==0 || b==0) { return 0; } return a%b==0?b:gcd(b,a%b); } public static void
main(String[] args) { Scanner sc=new Scanner(System.in); int x1=sc.nextInt();
int x2=sc.nextInt(); Main t=new Main(); int
Min=x1>x2?t.gcd(x1,x2):t.gcd(x2,x1); int k=1,temp=0,Ma=0,Mi=0;; if(x1>x2) {
temp=t.gcd(x1+k,x2+k); Ma=x1+k; Mi=x2+k; }else { temp=t.gcd(x2+k,x1+k);
Ma=x2+k; Mi=x1+k; } while(temp<=Min) { k++; temp=t.gcd(Ma+k,Mi+k); }
System.out.println(k); } }
5.蜂巢

可以采用回溯或者dfs、bfs等，关键在如何选择边界条件。稍后更新，暂时不更，因为需要最优化判断。

。。。。。

6.全排列的价值

此题采用数学方法即可
import java.util.Scanner; public class Main{ public static void main(String[]
args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if (n == 0
|| n == 1) { System.out.println(0); return; } long flag = 2; long count = 1;
for (int x= 3; x < n+1; x++) { count = ((count * x * (x - 1) / 2) % 998244353 +
(count * x) % 998244353) % 998244353; flag = (x * flag) % 998244353; }
System.out.println(count); } }
7.青蛙过河

8.因数平方和

所给题目样例输出错误，傻逼的题目一个
import java.util.Scanner; public class Main{ public static void main(String[]
args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close();
long[] arr = new long[n + 1]; long sum = 0; for (long i = 1; i < arr.length;
i++) { long j = i; while (j < arr.length) { arr[(int) j] = (arr[(int) j] + i *
i) % 1000000007; j += i; } sum = (sum + arr[(int) i]) % 1000000007; }
System.out.println(sum); } }
9.最优清0方案

GitHub

Gitee