摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; string in,post; void preorder(int inl,int inr,int postl,int postr) { if(inl>inr||postl>postr) retu 阅读全文
posted @ 2025-12-09 00:27 gosaky 阅读(7) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e5+10; LL a[N]; LL n,m; bool check(LL mid) { LL t=0,cnt=1; for( 阅读全文
posted @ 2025-12-08 17:35 gosaky 阅读(4) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e6+10; int n; LL a[N],s[N]; int main() { cin>>n; LL sum=0; for( 阅读全文
posted @ 2025-12-08 16:41 gosaky 阅读(3) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e5+10; int n,k; LL a[N],b[N],s[N]; bool check(LL x) { //预处理前缀和数 阅读全文
posted @ 2025-12-08 10:30 gosaky 阅读(4) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=110; const char null='*'; vector<char> str(N,'*'); int n; //使用erase函数 int main() { cin 阅读全文
posted @ 2025-12-08 09:15 gosaky 阅读(4) 评论(0) 推荐(0)
摘要: 点击查看代码 #include <iostream> using namespace std; const int MOD = 1e9+7; int main() { int n; cin >> n; long long sum_mod = 0; for (int i = 0; i < n; i++ 阅读全文
posted @ 2025-12-08 08:39 gosaky 阅读(5) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N = 15; char g[N][N]; int n; int cnt; // 是一个二进制数,表示第i行的哪些位置可以放皇后,1表示可放,0表示不可以放 int row_m 阅读全文
posted @ 2025-12-05 10:57 gosaky 阅读(4) 评论(1) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef unsigned long long ULL; const int N=3e5+10,P=131; ULL h[N],p[N]; char str[N]; //记录符合要求的字串的 阅读全文
posted @ 2025-12-04 16:20 gosaky 阅读(8) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n; cin>>n; unordered_map<string,i 阅读全文
posted @ 2025-12-04 10:54 gosaky 阅读(4) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N=1e5+10,null=0x3f3f3f3f; int h[N]; int find(int x) { int t=(x%N+N)%N; while(h[t]!=null& 阅读全文
posted @ 2025-12-04 09:37 gosaky 阅读(5) 评论(0) 推荐(0)