上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 54 下一页
  2023年2月24日
摘要: 给了三个数: p,q,r(−1e9<=p,q,r<=1e9)p,q,r(−1e9<=p,q,r<=1e9) 然后给了n个数a1,a2...an(−1e9<=ai<=1e9)a1​,a2​...an​(−1e9<=ai​<=1e9) 求找出三个数ai,aj,ak(1<=i<=j<=k<=n)ai​,a 阅读全文
posted @ 2023-02-24 12:27 towboat 阅读(13) 评论(0) 推荐(0)
摘要: 对字符串s,多次询问,给你两个数L和R,问在字符串区间l到r的字串中,包含多少回文串。 #include <iostream> #include<queue> #include <cstring> #define IOS std::ios::sync_with_stdio(0) using name 阅读全文
posted @ 2023-02-24 00:41 towboat 阅读(15) 评论(0) 推荐(0)
  2023年2月23日
摘要: 给你一个长度为 n(1≤n≤500)n(1≤n≤500) 的数组 aa,每次你可以进行以下两步操作: 找到 i∈[1,n)i∈[1,n),使得 ai=ai+1ai​=ai+1​; 将 它们 替换为 ai+1ai​+1。 每轮操作之后,显然数组的长度会减小 11,问剩余数组长度的最小值。 #inclu 阅读全文
posted @ 2023-02-23 23:27 towboat 阅读(21) 评论(0) 推荐(0)
  2023年2月22日
摘要: 给定一个序列 A,求有多少非空序列 B 满足 B 是 A 的子序列 并且 ∀ k ∈ [1,lenb], k∣bk∀ k ∈ [1,lenb​], k∣bk​, // f[i][j]= f[i-1][j] + (f[i-1][j-1] ,a[i]%j==0 ) 优化: 枚举 a[i] 的因数作为 j 阅读全文
posted @ 2023-02-22 18:52 towboat 阅读(16) 评论(0) 推荐(0)
摘要: 有 n个数,每一次取一个 x ,将其删除,并将所有值为x+1 与 x−1 的数都删除,ans 加上x ,求最后最大的ans 的值. (1<=a[i]<=1e5) 考虑 f[ i ] 1~i 的数字 最大ans ,f[i]=max{ f[i-1], f[i-2]+cnt[i] *i ) #includ 阅读全文
posted @ 2023-02-22 15:12 towboat 阅读(22) 评论(0) 推荐(0)
摘要: x,y= map(int,input().split()) print(x," ",y) 9TTXwpbgdWhtkB3 a=[32,43,21,431] a.append(3) a.remove(21) print(a) a.extend([98,21]) print(a) a.insert(0, 阅读全文
posted @ 2023-02-22 12:55 towboat 阅读(7) 评论(0) 推荐(0)
摘要: 大意是:给你nn个字符串,将这些字符串拼接,求一个最长的序列,使这个其中每个串的最后一个字母与第一个字母相同(最后一个串的最后一个字母与第一个串的第一个字母相同),而且后面的串只能接在前面的串的后边。 f[ch][ch] 首尾为ch , 的最大长度 对某个 串s , f[j][y]= max{ f[ 阅读全文
posted @ 2023-02-22 11:52 towboat 阅读(21) 评论(0) 推荐(0)
摘要: https://vjudge.net/problem/POJ-1149 #include <iostream> #include<queue> #include <cstring> #define IOS std::ios::sync_with_stdio(0) using namespace st 阅读全文
posted @ 2023-02-22 00:15 towboat 阅读(22) 评论(0) 推荐(0)
  2023年2月21日
摘要: 对01序列 区间异或,求区间和 #include <iostream> #include<queue> #include <cstring> #define IOS std::ios::sync_with_stdio(0) using namespace std; #define rt1 rt<<1 阅读全文
posted @ 2023-02-21 18:02 towboat 阅读(24) 评论(0) 推荐(0)
  2023年2月20日
摘要: #include <iostream> #include <map> #include <algorithm> #include <cstring> using namespace std; const int N =203 ,M =N; typedef long long ll; int n,m, 阅读全文
posted @ 2023-02-20 18:46 towboat 阅读(18) 评论(0) 推荐(0)
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 54 下一页