码迷,mamicode.com
首页 >  
搜索关键字:cout    ( 7219个结果
HDU 1312 Red and Black
水题~ const int N=25; char g[N][N]; bool vis[N][N]; int n,m; PII st; bool check(int x,int y) { return x>=0 && x<n && y>=0 && y<m; } int bfs() { queue<PI ...
分类:其他好文   时间:2020-12-24 12:06:48    阅读次数:0
Transformation HDU - 4578
简单线段树操作 咕咕咕 Transformation HDU - 4578 vj talk is cheap, chow the code. #include <iostream> #include <cstring> using namespace std; typedef long long l ...
分类:其他好文   时间:2020-12-23 12:30:38    阅读次数:0
c++日常小问题
语法解析问题。 当给一个变量构造函数传递一个临时变量,而不是命名的变量,c++编译器会将其解析为函数声明,而不是类型对象的定义。 class hello { void operator()() { std::cout << "hello"; } } std::thread haha(hello()) ...
分类:编程语言   时间:2020-12-23 12:13:08    阅读次数:0
Codeforces Round #690 (Div. 3)
Codeforces Round #690 (Div. 3) A - Favorite Sequence 按着题意读入, 顺序输出完事 int main() { IOS; for (cin >> _; _; --_) { cin >> n; rep (i, 1, n) { if (i <= (n + ...
分类:其他好文   时间:2020-12-21 12:02:47    阅读次数:0
前置++与后置++区别
前置是先自加再使用,而后置是先使用再自加! 此处自加自减指的是变量的值,使用指的是使用该变量。 即:前加加就是先加,然后才用这个变量;后加加就是先用这个变量,然后在对这个变量做自增。 int i = 10; cout << ++i << endl;//此时输出11 int i = 10; cout ...
分类:其他好文   时间:2020-12-10 11:10:42    阅读次数:4
vector
vector 1 基本操作 (1)头文件#include<vector>. (2)创建vector对象,vector<int> vec; (3)尾部插入数字:vec.push_back(a); (4)使用下标访问元素,cout<<vec[0]<<endl;记住下标是从0开始的。 (5)使用迭代器访问 ...
分类:其他好文   时间:2020-12-08 12:18:02    阅读次数:3
P3000 [USACO10DEC]Cow Calisthenics G
二分 + \(dp\) 的好题。 首先,要求最大直径最小,我们肯定会想到二分最大直径。 难点就在于怎么 \(check\)。 记录数组 \(dp_u\) 表示在 \(u\) 号点,其子树到达 \(u\) 号点的最大链长。转移时,考虑其和子树之间的关系。 可以发现,\(u\) 号点就类似于一个 \(l ...
分类:其他好文   时间:2020-12-07 12:41:01    阅读次数:8
C++中cout.setf()函数
C++中cout.setf(ios::left,ios::adjustfield); cout.setf(ios::showpoint,ios::showpint);cout.setf(ios::scientific,ios::floatfield);分别表示什么 参考以下: 1.使用控制符控制输出 ...
分类:编程语言   时间:2020-12-07 12:08:26    阅读次数:6
理解递归
1 #include <iostream> 2 using namespace std; 3 int abc(int); 4 int fun1(int); 5 int fun1(int a) 6 { 7 cout << "递归函数1" << endl; 8 if (a == 1) 9 { 10 re ...
分类:其他好文   时间:2020-12-07 12:04:33    阅读次数:4
二维差分
二维差分 我们有一个矩阵,如下图所示: 假设我们有这么一个矩阵: 1 2 4 3 5 1 2 4 6 3 5 9 二维前缀和公式: sum[i][j]=sum[i][j-1]+sum[i-1][j]-sum[i-1][j-1]+arr[i][j]; 差分: 如果我们要在左上角是 (x1,y1),右下 ...
分类:其他好文   时间:2020-12-04 11:48:01    阅读次数:22
7219条   上一页 1 ... 12 13 14 15 16 ... 722 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!