2025年8月8日
摘要: https://ac.nowcoder.com/acm/contest/108576/E 给定一个长度为 n 的 01 串,其中 1 表示白色,0 表示黑色。现在需要对这个字符串进行恰好 k 次染色操作,每次染色操作必须选择之前未被选择过的位置,将该位置的颜色取反(即白色变黑,黑色变白)。染色完成后 阅读全文
posted @ 2025-08-08 14:43 下头小美 阅读(8) 评论(0) 推荐(0)
  2025年8月7日
摘要: https://www.cnblogs.com/dx123/p/17003464.html 阅读全文
posted @ 2025-08-07 22:39 下头小美 阅读(3) 评论(0) 推荐(0)
  2025年8月5日
摘要: #include<cstdio> #include<algorithm> using namespace std; typedef long long LL; int main(){ LL n, k, l, r, res; scanf("%lld%lld", &n, &k); res = n*k; 阅读全文
posted @ 2025-08-05 21:35 下头小美 阅读(6) 评论(0) 推荐(0)
  2025年8月4日
摘要: 、#include <bits/stdc++.h> using namespace std; #define N 200005 #define LL long long #define lc (u << 1) #define rc (u << 1 | 1) const int mod = 99824 阅读全文
posted @ 2025-08-04 17:21 下头小美 阅读(9) 评论(0) 推荐(0)
  2025年8月1日
摘要: #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N=50010, M=210, P=1e9+7; long long S[N][M], C[M][M]; void i 阅读全文
posted @ 2025-08-01 12:39 下头小美 阅读(5) 评论(0) 推荐(0)
  2025年7月25日
摘要: 用线性筛预处理出质数,然后用val存每个数的最小质数 void getp() { for (int i = 2; i <= N;i++) { if(!st[i]) { prime[cnt++] = i; val[i] = i; } for (int j = 0;prime[j]<=N/i;j++) 阅读全文
posted @ 2025-07-25 11:39 下头小美 阅读(8) 评论(0) 推荐(0)
  2025年7月24日
摘要: void divide(int x) { for (int i = 2; i <= x / i; i ++ ) if (x % i == 0) { int s = 0; while (x % i == 0) x /= i, s ++ ; cout << i << ' ' << s << endl; 阅读全文
posted @ 2025-07-24 00:14 下头小美 阅读(3) 评论(0) 推荐(0)
  2025年7月8日
摘要: include include include using namespace std; const int N=100010; int n, a[N]; int len, b[N]; //记录上升子序列 int main(){ scanf("%d", &n); for(int i=0; i<n; 阅读全文
posted @ 2025-07-08 14:55 下头小美 阅读(51) 评论(0) 推荐(0)
  2025年7月6日
摘要: include include include using namespace std; const int N=1010; int n, m; char a[N], b[N]; int f[N][N]; int main(){ cin>>n>>m>>a+1>>b+1; for(int i=1; i 阅读全文
posted @ 2025-07-06 14:49 下头小美 阅读(3) 评论(0) 推荐(0)
  2025年6月10日
摘要: 区间推平:给l,r ,把【l,r】 中的元素全变成x 例题:https://ac.nowcoder.com/acm/contest/111159/F 模板// #include<bits/stdc++.h> #define ios ios::sync_with_stdio(0),cin.tie(0) 阅读全文
posted @ 2025-06-10 15:18 下头小美 阅读(5) 评论(0) 推荐(0)