摘要: 比赛链接https://www.luogu.com.cn/contest/56279 代码是看了直播讲解之后写(cv)出来的~ A题: 听了直播讲解后……我才明白这题是纯纯暴力啊,我还以为要用string判断再转回int啥啥啥的…… 这份代码是C++的 #include <bits/stdc++.h 阅读全文
posted @ 2021-11-20 22:34 Selma003 阅读(795) 评论(0) 推荐(0)
摘要: At first: lang包是最基础的包,所以lang包下直接的类是不需要导入的,但是lang包下的子包依然是需要导入的。 如果硬是要导入的话, 导入lang包下直接的类这样写:import java.lang.* 导入lang包子包下的类这样写:import java.lang.reflect. 阅读全文
posted @ 2021-11-15 20:59 Selma003 阅读(45) 评论(0) 推荐(0)
摘要: 无注释的: #include <bits/stdc++.h> using namespace std; const int N = 100005; int a[N]; void quickSort(int q[], int l, int r){ if(l >= r){ return; } int i 阅读全文
posted @ 2021-11-11 20:50 Selma003 阅读(157) 评论(0) 推荐(0)
摘要: 不带注释的选择排序: public void sort(int[] i) { for (int j = 0; j < i.length - 1; j++) { int min = i[j]; //假定最小值为当前值 int temp = j; //记录最小值的下标 for (int z = j; z 阅读全文
posted @ 2021-10-25 12:23 Selma003 阅读(84) 评论(0) 推荐(0)
摘要: 原题链接:https://codeforces.com/problemset/problem/208/A 学习链接:https://blog.csdn.net/cs_zlg/article/details/7782625 #include <bits/stdc++.h> using namespac 阅读全文
posted @ 2021-10-25 12:15 Selma003 阅读(39) 评论(0) 推荐(0)
摘要: 原题链接:https://codeforces.com/problemset/problem/82/A #include<bits/stdc++.h> using namespace std; int main(){ //1 2 3 4 //5 10 20 40 //等比数列 a^n = a^1 * 阅读全文
posted @ 2021-10-23 23:22 Selma003 阅读(48) 评论(0) 推荐(0)
摘要: “水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=1³+5³+3³ 我们一般的写法: #include <iostream> #include <cstring> #include <algorithm> using namespace std; int main(){ fo 阅读全文
posted @ 2021-09-23 20:15 Selma003 阅读(99) 评论(0) 推荐(0)
摘要: 弧度与角度的转换 PI = 3.1415926 1rad = (180 / PI)° 1° = (PI / 180)rad c++的math.h(cmath)中的cos(x)方法,就是我们平时做题写的y = cos x,余弦函数,求一个角度对应的y值,y的范围为[-1, 1]。 另外还有acos(x 阅读全文
posted @ 2021-08-01 11:45 Selma003 阅读(1987) 评论(0) 推荐(0)
摘要: 因为带测试数据,所以就稍微分开一些。 以下有矢量加减法、求斜率、求一堆点中一条直线能包括的最多点的数量、点积运算。 #include <iostream> #include <cstdio> #include <algorithm> using namespace std; double ax[5] 阅读全文
posted @ 2021-07-31 18:03 Selma003 阅读(102) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 50005, inf = 0x3f3f3f3f; //N是POJ3264的数据范围, //inf:0x3f3f3f3f的十进制是1061109567,是10^9级别的 int a[N 阅读全文
posted @ 2021-07-24 10:59 Selma003 阅读(104) 评论(0) 推荐(0)