上一页 1 2 3 4 5 6 7 ··· 15 下一页
摘要: 1 class Solution { 2 public: 3 typedef pair<int,int> pii; 4 const int k1=1331; 5 const int k2=13331; 6 const int mod1=1e9+7; 7 const int mod2=1e9+9; 8 阅读全文
posted @ 2022-04-04 23:10 matt-11 阅读(52) 评论(0) 推荐(0)
摘要: 无论是求最大值还是最小值;能量差值del=now-ans; del的正负性无关紧要,重要的是del的差值,也就是绝对值大小; 如果当前求的是最大值if(now>ans)ans=now,说明现在的值更优,否则完美以一定概率接受劣质解; 如果del越大说明劣质解偏差较大,我们接受它的概率就要小,否则劣质 阅读全文
posted @ 2022-04-03 20:57 matt-11 阅读(32) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; typedef long long ll; ll ans,n,sum; int a[100]; int f() { int t=0; for(int i=1;i<=n/2;i++)t+=a[i]; return 阅读全文
posted @ 2022-04-03 16:29 matt-11 阅读(22) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 typedef double db; 5 const int N=1e3+5; 6 db ansx,ansy,answ; 7 int n; 8 str 阅读全文
posted @ 2022-04-03 15:50 matt-11 阅读(49) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=200200; 5 int dep[N],fa[N][30],color[N],bin[N],blg[N],ord[N],in 阅读全文
posted @ 2022-04-03 13:58 matt-11 阅读(43) 评论(0) 推荐(0)
摘要: 最坑的是输入除了'Q','R'还有其他字母; 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=1e6+5; 5 int color[N],blg[N],cnt[N],ans[ 阅读全文
posted @ 2022-03-29 22:59 matt-11 阅读(30) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=2e5+5; 5 int n,m,p,l=1,r=0,tot=0; 6 ll blg[N],suff[N],bin[N],f[ 阅读全文
posted @ 2022-03-27 22:27 matt-11 阅读(29) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=5e4+5; 5 ll a[N],blg[N],cnt[N]; 6 string ans[N]; 7 inline ll gc 阅读全文
posted @ 2022-03-27 17:38 matt-11 阅读(30) 评论(0) 推荐(0)
摘要: long long ! long long ! long long! 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int N=3e6+5; 4 int inv[N]; 5 int main() 6 { 7 int n,p; 8 c 阅读全文
posted @ 2022-03-20 22:12 matt-11 阅读(36) 评论(0) 推荐(0)
摘要: //1007为质数,运用二项式展开,且对于1-1006与1007互质,用费马小定理可以求组合数的分母mod1007,也就是求逆元 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int mod=1e4+7; 4 int a,b,k,n 阅读全文
posted @ 2022-03-17 22:29 matt-11 阅读(102) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 15 下一页