码迷,mamicode.com
首页 >  
搜索关键字:cstring    ( 6726个结果
树状数组241. 楼兰图腾
#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int N = 2000010; typedef long long LL; int n; //t[i]表示树状数组i结点覆盖的范围 ...
分类:编程语言   时间:2020-09-11 14:22:54    阅读次数:34
C. Binary String Reconstruction
题意:考虑如下的过程。你有一个长度为n的二进制串w还有一个整数x。你构建了一个长度为n的二进制串s。二进制串s的第i个字符串的选择如下: 1.如果$w_$存在并且等于1,那么$s_$则等于1。 2.如果$w_{i+x}$存在并且等于1,那么$s_$则等于1。 3.如果前两种情况都不存在,那么$s_$ ...
分类:其他好文   时间:2020-09-07 18:58:25    阅读次数:45
D - Permutation Counting
http://acm.hdu.edu.cn/showproblem.php?pid=6880 根据长度为n的排列a,构造长度n-1的序列b 思路:DP 官方题解: 代码: #include<iostream> #include<cstdio> #include<cstring> #include<a ...
分类:其他好文   时间:2020-09-03 17:00:42    阅读次数:38
C++字符串反转
c++ 字符串反转的3种方法 1、使用string.h中的strrev函数 #include <iostream> #include <cstring> using namespace std; int main() { char s[] = "hello"; strrev(s); cout<< s ...
分类:编程语言   时间:2020-08-18 15:36:13    阅读次数:66
poj3237 Tree
树链剖分基本操作: 1. 修改第i条边的权值。 2. 对树上一条路径的权值取反(正变负,负变正)。 3. 查询树上一条路径的权值的最大值。 因为要取反,所以要同时维护最大值和最小值。 1 #include<cstdio> 2 #include<cstring> 3 #include<algorith ...
分类:其他好文   时间:2020-08-18 13:36:03    阅读次数:62
计蒜客 T1725 国王的魔镜
首先取出这个项链的长度x,如果他是回文数的话让项链减去一半,x减去一半,如果他不是回文数,就退出循环 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#inc ...
分类:其他好文   时间:2020-08-13 12:13:39    阅读次数:53
Paperfolding
https://vjudge.net/contest/387654#problem/I 算数学期望 对折和切刀都会使数量翻倍 横着切刀和上下对着效果相同,竖着切刀和左右对折效果相同 #include<iostream> #include<cstdio> #include<cstring> #incl ...
分类:其他好文   时间:2020-08-08 21:21:48    阅读次数:78
P3327 [SDOI2015]约数个数和
#include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #define inf 2147483647 #define N 10000 ...
分类:其他好文   时间:2020-08-07 12:34:32    阅读次数:75
带花树匹配
带花树匹配 1.算法分析 2. 算法模板 #include<iostream> #include<cstdio> #include<cstdlib> #include<string> #include<cstring> #include<cmath> #include<ctime> #include ...
分类:其他好文   时间:2020-08-03 23:08:37    阅读次数:72
Lock Her Up
题意描述 同样没有链接...。 Problem 2: Lock Her Up [Jan Kuipers, 2003] Bessie has been bad again and Farmer John must punish her by locking her up for a while. On ...
分类:其他好文   时间:2020-08-02 23:35:51    阅读次数:104
6726条   上一页 1 ... 12 13 14 15 16 ... 673 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!