码迷,mamicode.com
首页 >  
搜索关键字:cout    ( 7219个结果
PAT(Basic Level) 1006
1 #include<iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 int n; 8 cin>>n; 9 10 if(n<10){ 11 for(int i=1;i<=n;i++) 12 cout<<i; 13 } 14 else i ...
分类:其他好文   时间:2020-07-22 01:39:51    阅读次数:69
中序遍历加后序遍历确定先序遍历
https://www.luogu.com.cn/problem/P1030 1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #define IO std::ios::sync_with_stdio(0) 3 #include <bits/stdc++.h> ...
分类:其他好文   时间:2020-07-21 21:48:07    阅读次数:55
DFS
深度优先搜索 一、特点 从最开始的状态出发,遍历所有能到达的地方,每个状态只会进行一次,通过递归的思想实现 二、例题 例一 部分和问题: 给定整数 a1、a2、…、an,判断是否可以从中选出若干数,使它们的和恰好为 k 限制条件 1 ≤ n ≤ 20 108 ≤ ai ≤ 108 108 ≤ k ≤ ...
分类:其他好文   时间:2020-07-21 09:29:40    阅读次数:110
一维&&二维树状数组
高级树状数组讲解:https://www.cnblogs.com/RabbitHu/p/BIT.html 树状数组 一维树状数组 单点修改,区间查询 https://loj.ac/problem/130 #include<bits/stdc++.h> #define INF 0x3f3f3f3f # ...
分类:编程语言   时间:2020-07-20 22:29:48    阅读次数:77
开灯问题
有n盏灯,编号为1-n,第一个人把所有灯打开,第二个人按下所有编号两倍的开关(这些灯被关掉),第三个人按下所有编号三倍的开关,以此类推,一共有k个人,问最后有哪些灯开着?输入:n和k,输出开着的灯的编号,k<=n<=1000样例输入:7 3 样例输出:1 5 6 7 代码如下 #include<io ...
分类:其他好文   时间:2020-07-20 13:24:26    阅读次数:159
Vscode C++配置
$1.$打开'查看->扩展',安装$C/C++$和$C/C++ Compile Run$ $2.$下载$Fira Code$(见此处),打开$tff$,选择$FiraCode-Regular.tff$,进行安装 $3.$打开'文件->首选项',修改$Font Size$为18,修改$Font Fam ...
分类:编程语言   时间:2020-07-20 10:42:21    阅读次数:78
习题:Guess the Root(高斯消元)
题目 传送门 思路 阿这 基本上就是暴力用高斯消元来搞就行了 因为$mod$很小,所以可以直接枚举$x$ 代码 #include<iostream> using namespace std; const int mod=1e6+3; int n=11; long long a[15][15]; lo ...
分类:其他好文   时间:2020-07-20 00:01:31    阅读次数:98
vj map
1 /* 2 * 换行好烦人呀! 3 */ 4 #include <iostream> 5 #include <map> 6 #include <string> 7 using namespace std; 8 map<string,map<string,int>> m; 9 int N; 10 i ...
分类:其他好文   时间:2020-07-19 15:56:26    阅读次数:56
C++ unique去重的常用用法
1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 5 using namespace std; 6 7 int main() 8 { 9 vector<int> nums{1,3,4,6,5,3,2,4,7,5}; ...
分类:编程语言   时间:2020-07-19 00:53:48    阅读次数:95
面试题15:二进制中1的个数
这个题目考察的是计算机基础知识。注意int型的-1在计算机中的二进制存储为补码0xFFFF FFFF,但是计算机在展示给我们的时候,是作为原码展示。 C++版 #include <iostream> using namespace std; int NumberOf1Plus(int n){ int ...
分类:其他好文   时间:2020-07-18 21:50:28    阅读次数:72
7219条   上一页 1 ... 22 23 24 25 26 ... 722 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!