摘要: STL的函数 lower_bound 与 upper_bound 意义:不用手写二分查找 lower_bound 找出序列中第一个大于等于x的数 upper_bound 找出序列中第一个大于x的数 写法 :lower_bound(a+1,a+n+1,x) 或 lower_bound(a+1,a+n+ 阅读全文
posted @ 2022-02-10 10:02 November&&Rain 阅读(68) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 char chr[256]; 4 int TOP = 0; 5 int TTOOPP = 0; 6 int top = 0; 7 int main(){ 8 int i = 1; 9 for(;;i 阅读全文
posted @ 2022-01-27 08:06 November&&Rain 阅读(25) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n,w,a[1000001],q[10000001],id[10000001]; 4 void min() 5 { 6 int st=0,ed=0; 7 for(int i=1;i<=w;i 阅读全文
posted @ 2022-01-26 15:31 November&&Rain 阅读(155) 评论(0) 推荐(1)
摘要: 带来的是一波题解~~~~~~ 1、 #include <cstdio>#include <algorithm>int n;char s[505];int main() { int n; long long ans = 0; scanf("%d", &n); scanf("%s", s + 1); s 阅读全文
posted @ 2022-01-25 14:17 November&&Rain 阅读(42) 评论(0) 推荐(0)
摘要: 搞心态了属于是。。。。。 先上我的 #include<bits/stdc++.h>using namespace std;int N;int s[101];int g[101];int h[101];int r[101];int c;int total = 0;bool up(int a,int b 阅读全文
posted @ 2022-01-24 16:31 November&&Rain 阅读(41) 评论(0) 推荐(0)
摘要: 组合数输出问题 题目描述 排列与组合是常用的数学方法,其中组合就是从n个元素中抽出r个元素(不分顺序且r≤n),我们可以简单地将n个元素理解为自然数1,2,…,n从中任取r个数。 现要求你输出所有组合。 例如n=5,r=3 所有组合为: 123,124,125,134,135,145,234,235 阅读全文
posted @ 2022-01-23 10:19 November&&Rain 阅读(128) 评论(0) 推荐(0)
摘要: 杠了三天的5桶桶排(也是迄今为止写过最长的代码)终于AC了,用学校电脑写个博纪念一下; #include<bits/stdc++.h>using namespace std;int s[1001] = {};bool cmp(int a,int b){return a<b;}// 升序;int MA 阅读全文
posted @ 2021-12-09 19:48 November&&Rain 阅读(147) 评论(0) 推荐(0)