设置默认的打印机 废话不多说,直接贴代码 : 这样,SMART就是你的默认打印机了。 注意:浏览器的安全级别一定要调低,允许执行ActiveX就行了 ...
分类:
Web程序 时间:
2020-07-28 17:21:28
阅读次数:
157
AcWing 788. 逆序对的数量 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e6+10; int q[N],tmp[N]; LL merge_sort(int l,int r) ...
AcWing 790. 数的三次方根 #include <bits/stdc++.h> using namespace std; int main(){ double n,mid; scanf("%lf",&n); double l=-1e6-10,r=1e6+10; while(r-l>1e-8) ...
AcWing 795. 前缀和 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int a[N],S[N]; int main(){ int n,m; scanf("%d%d",&n,&m); for(int i=1 ...
AcWing 796. 子矩阵的和 #include <bits/stdc++.h> using namespace std; const int N=1e3+10; int a[N][N],S[N][N]; int main(){ int n,m,q; scanf("%d%d%d",&n,&m,& ...
题目 给出二维平面内的$n$个带权节点,初始时$x$轴和$y$轴已标记 你可以新增$k$个平行于坐标轴的标记轴 一个点的代价定义为该点到最近的标记轴的距离和该点权值的乘积 对于$k = 0 \to n $ ,依次输出最小代价和 $1 \le n \le 15 \ , \ -104 \le x_i , ...
分类:
其他好文 时间:
2020-07-27 23:54:22
阅读次数:
84
求一个3 X 3的整形矩阵对角线元素之和 【答案解析】 矩阵:即二维数组,矩阵行和列相等的二维数组称为方阵。 1 2 3 4 5 6 7 8 9 左上角到右下角对角线上数字:行下标和列下标相等 右上角到左下角对角线上数字:列下标减1 行下标加一 通过两个循环来取到对角线上的元素,并对其求和即可。 【 ...
分类:
其他好文 时间:
2020-07-27 17:37:28
阅读次数:
73
题目链接: http://poj.org/problem?id=2253 题意: 找从起点到终点所有可能的路径中的最大边权的最小值 思路: 最短路变形 将松弛操作判断条件 dist[v]>dist[u]+w[u][v] 改为 dist[v]>max(dist[u],w[u][v]) 更新操作 dis ...
分类:
其他好文 时间:
2020-07-27 09:48:03
阅读次数:
79
Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? InputThe first line of input contains N, the number ...
分类:
其他好文 时间:
2020-07-27 09:42:59
阅读次数:
80
这道题其实难度不算大,关键是有点坑。。。 下面讲讲我做此题的一些心得: 测试点2是白给,如果测试点2都过不了就完全是程序逻辑的问题。 测试点0和3 对应的是输出空格的问题,即当每行的字符输出完以后,无需再在其右侧输出空格。 测试点1 对应的是当所给数字恰好能构成一个沙漏时,也需输出0 (题目给的例子 ...
分类:
其他好文 时间:
2020-07-27 09:36:14
阅读次数:
64