码迷,mamicode.com
首页 >  
搜索关键字:printf    ( 15030个结果
[cf1307D] Cow and Fields
"题目链接" 题意 给出$n$个点$m$条边的无向图与$k$个特殊点,要在两个特殊点间添加一条边,求从$1$到$n$最短路的最大值。 题解 $p_i$表示从$1$出发到$i$的最短路,$q_i$表示从$n$出发到$i$的最短路。选择两个特殊点$a$和$b$使$\min(p_a+q_b+1,q_a+p ...
分类:其他好文   时间:2020-05-05 23:19:50    阅读次数:86
C++:地平线2019相关题
[TOC] 无符号数和有符号数相加 题目 int main() { unsigned int a = 6; int b = 20; (a + b 6) ? puts(" 6") : puts("<6"); // a+b 按无符号数计算,结果为无符号数 printf("a+b=%d\n",(a+b)) ...
分类:编程语言   时间:2020-05-05 17:37:42    阅读次数:62
输入一个大于3的整数n,判断它是否为素数
#include <stdio.h> //让n被i除(i的值从2到n-1)int main(){ int n,i; printf("please enter a integer number,n=?"); scanf("%d",&n); for(i=2;i<=n-1;i++) if(n%i==0) ...
分类:其他好文   时间:2020-05-05 12:49:00    阅读次数:274
分块见习
分块初始化: int a[50005];//原始序列 int l[2000];//第i个块的左区间端点 int r[2000];//第i个块的右区间端点 int pos[50005];//第i个点属于第几个块 int n; scanf("%d",&n); int dis=sqrt(n);//每一块的 ...
分类:其他好文   时间:2020-05-05 12:46:01    阅读次数:46
int 变量的默认初始值
int 变量的默认初始值为0 这可以写个小程序测试下: #include <stdio.h> int main() { int i; if (i == 0) { printf("Hola, mundo, i = %d\n", i); } return 0; } 运行结果为: Hola, mundo, ...
分类:其他好文   时间:2020-05-05 12:36:37    阅读次数:446
Codeforces Round #637 (Div. 2) 题解
A. Nastya and Rice 网址:https://codeforces.com/contest/1341/problem/A Nastya just made a huge mistake and dropped a whole package of rice on the floor. ...
分类:其他好文   时间:2020-05-04 21:28:22    阅读次数:77
数值分析实验之线性方程组的迭代求解(MATLAB实现)
详细实验指导见上上一篇,此处只写内容啦 实验内容: 求解如下4元线性方程组的近似解。 Gauss-Seidel迭代 A=[10,-1,2,0;-1,11,-1,3;2,-1,10,-1;0,3,-1,8]; b=[6;25;-11;15]; x=zeros(4,1); temp=zeros(4,1) ...
分类:其他好文   时间:2020-05-04 21:05:54    阅读次数:64
100136. 冒泡的胖头鱼Out of Sorts
100136 题解 分界线i的产生当且仅当右边属于左边的全部移过去,等价于右边要移的最大的数前要移到右边的数个数,等于最大位置 i,设为c[i] 然后一个数算的次数=max(c[i 1],c[i]),0要当做1来算 ~~不需要用栈~~ code ...
分类:其他好文   时间:2020-05-04 17:25:40    阅读次数:52
kd-tree板子
#include<iostream> #include<cstdio> #include<algorithm> #include<vector> #include<cmath> #define alpha (0.75) using namespace std; const int N = 6e5 + ...
分类:其他好文   时间:2020-05-04 17:23:34    阅读次数:49
最大数和最小数
最大数#include <stdio.h>#define MAX 10int main() { int n, a[MAX]; printf("Input the number of figure(<10):\n"); scanf("%d",&n); for (int i = 0; i < n; i+ ...
分类:其他好文   时间:2020-05-04 15:48:54    阅读次数:172
15030条   上一页 1 ... 72 73 74 75 76 ... 1503 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!