摘要:
使用scanf和cin可以保证遇到空格或者换行符就读入下一个变量 scanf("%s",s+1); 这只能用char数组上,不能用在string上 n = strlen(s+1);这能用在char数组上 string 使用length或者size函数求,这样的时间复杂度是o1,因为string内部维 阅读全文
posted @ 2026-02-25 01:45
peter_shen
阅读(10)
评论(0)
推荐(0)
摘要:
完全没想到前缀和数组 #include <bits/stdc++.h> using namespace std; const int N=3e3+10; int num[N][N]; int pre[N][N]; int n,m; bool judge(int mid){ for(int i=mid 阅读全文
posted @ 2026-02-25 00:54
peter_shen
阅读(10)
评论(0)
推荐(0)
摘要:
二分查找+前缀和 #include <bits/stdc++.h> using namespace std; const int N=1e5+10; typedef long long LL; LL pred[N]; int a[N],n,S; bool judge(int mid){ for(in 阅读全文
posted @ 2026-02-25 00:27
peter_shen
阅读(10)
评论(0)
推荐(0)
摘要:
 阅读全文
posted @ 2026-02-25 00:08
peter_shen
阅读(7)
评论(0)
推荐(0)

浙公网安备 33010602011771号