![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串专项
人面桃花相映红
BNU student
展开
-
欢迎使用CSDN-markdown编辑器
这里写代码片 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <string> using namespace std; int a[30]; string s; int mini = 10000; bool zhishu(int n) { if (n == 0 ||原创 2016-07-29 10:32:29 · 587 阅读 · 0 评论 -
模拟大数相加
string add(string s1, string s2) { if (s1 == ""&&s2 == "") return "0"; if (s1 == "") return s2; if (s2 == "") return s1; string max = s1, min = s2; if (s1.length() < s2.原创 2016-09-20 21:53:13 · 163 阅读 · 0 评论 -
模拟大数相加
杭电1002 用字符串模拟过程 #include<stdio.h> #include<string.h> int main() { char a1[1002],a2[1002]; int c,i,j,n,m,s1[1002],s2[1002],l1,l2,count; count=1; sc原创 2016-09-25 10:50:11 · 168 阅读 · 0 评论 -
nyoj 1112 求次数
http://acm.nyist.net/JudgeOnline/problem.php?pid=1112 求次数 时间限制:1000 ms | 内存限制:65535 KB 难度:2描述题意很简单,给一个数n 以及一个字符串str,区间【i,i+n-1】 为一个新的字符串,i 属于【0,strlen(str)】如果新的字符串出现过ans++,例如:acmacm n=3,那么 子串为acm原创 2016-11-21 00:16:15 · 320 阅读 · 0 评论 -
大数阶乘 nyoj 28
大数阶乘 纯手动模拟乘法; 题目链接 http://acm.nyist.net/JudgeOnline/problem.php?pid=28 #include<stdio.h> #include<string.h> const int maxn=20000; int a[maxn]; int main() { int n,i,j,s,c; scanf("%d",&n); memset(a,0,原创 2016-11-24 15:49:33 · 246 阅读 · 0 评论 -
文章标题
、next_permutation实现原理在《STL源码解析》中找到了这个函数,在此也简单叙述一下原理:在STL中,除了next_permutation外,还有一个函数prev_permutation,两者都是用来计算排列组合的函数。前者是求出下一个排列组合,而后者是求出上一个排列组合。所谓“下一个”和“上一个”,书中举了一个简单的例子:对序列 {a, b, c},每一个元素都比后面的小,按照字典序原创 2017-02-27 20:14:20 · 175 阅读 · 0 评论