上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 54 下一页
  2022年12月2日
摘要: #include "bits/stdc++.h" using namespace std; const int N=1e3+3; int n,m,a[N][N],s[N][N]; int A; int w[N],h[N],pp; void sov(int x){ int i,ans=0; pp=0; 阅读全文
posted @ 2022-12-02 19:43 towboat 阅读(15) 评论(0) 推荐(0)
摘要: 超市里有n件商品,每件商品都有利润v[i] 和过期时间tm[i] , 每天只能卖一件商品,过期商品不能卖。 求可以得到的最大收益 #include "bits/stdc++.h" using namespace std; const int N=1e5+5; struct T{ int v,tm; 阅读全文
posted @ 2022-12-02 18:14 towboat 阅读(14) 评论(0) 推荐(0)
  2022年12月1日
摘要: 把字符串S的所有后缀按照字典序排列,排名为 i 的后缀记为SA[ i ] 额外地,我们考虑排名为 i 的后缀与排名为 i-1 的后缀,把二者的最长公共前缀的长度记为 hgt[i] 使用快排、Hash 与二分 求出 两个数组 #include<iostream> #include <algorithm 阅读全文
posted @ 2022-12-01 19:09 towboat 阅读(30) 评论(0) 推荐(0)
摘要: 枚举回文串的中心点 ,二分左右的长度 判断两个字符串时用hash #include<iostream> #include <algorithm> #include <cstring> using namespace std; #define ll unsigned long long const i 阅读全文
posted @ 2022-12-01 15:05 towboat 阅读(20) 评论(0) 推荐(0)
摘要: 用map<int,bool> #include "bits/stdc++.h" using namespace std; const int N=1e4+5; #define int unsigned long long const int mod=212370440130137957ll; cha 阅读全文
posted @ 2022-12-01 13:46 towboat 阅读(28) 评论(0) 推荐(0)
  2022年11月30日
摘要: #include "bits/stdc++.h" using namespace std; const int N=1e5+3; #define int long long int n,a[N]; int hh,stk[N],w[N]; void sov(){ hh=0; memset(a,0,si 阅读全文
posted @ 2022-11-30 23:58 towboat 阅读(29) 评论(0) 推荐(0)
摘要: dp (n^2) #include "bits/stdc++.h" using namespace std; int n,f[35][35]; int dp(int i,int j){ if(f[i][j]!=-1) return f[i][j]; f[i][j]=0; if(i==0) retur 阅读全文
posted @ 2022-11-30 22:27 towboat 阅读(31) 评论(0) 推荐(0)
摘要: 给一些区间【l , r】 , 区间i 内间隔 d[i] 有一个点(可能会重复),保证最后只有一个位置的点数为奇数,其他位置的点数为偶数 找出这个点 二分查找 二分点的位置,注意题目中唯一的奇数点 求区间和,判断奇偶性,缩小范围 #include "bits/stdc++.h" using names 阅读全文
posted @ 2022-11-30 16:50 towboat 阅读(17) 评论(0) 推荐(0)
摘要: #include <iostream> #include <algorithm> using namespace std; const int N=1100; struct T{ int x,y; } a[N]; int n; string c[N][2]; int cmp(T &a,T &b){ 阅读全文
posted @ 2022-11-30 14:21 towboat 阅读(125) 评论(0) 推荐(0)
  2022年11月29日
摘要: 给n个区间,设置最少的点,每个区间都有至少一个点 区间按照右端点排序,每次贪心取区间右端点 #include <bits/stdc++.h> using namespace std; const int N=5e4+3; struct T{ double l,r; bool operator<(co 阅读全文
posted @ 2022-11-29 22:05 towboat 阅读(33) 评论(0) 推荐(0)
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 54 下一页