03 2022 档案
摘要:最坑的是输入除了'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[
阅读全文
摘要: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[
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要://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
阅读全文
摘要:1 class Solution { 2 public: 3 bool isBipartite(vector<vector<int>>& graph) { 4 int n=graph.size(); 5 vector<int>G[n],f(n,0); 6 for(int i=0;i<n;i++) 7
阅读全文
摘要:// 约旦消元相比朴素高斯消元,代码量少,而且都能判无解,无穷解,唯一解;无穷解是代码中判,结束后如果a[i][i]==0&&a[i][n+]!=0无解,否则唯一解 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 {
阅读全文
摘要:1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 const int mod=10000; 6 int n; 7 struct matrix 8 { 9 int data[2][2
阅读全文
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=1e5+5; 5 vector<ll>v[N]; 6 ll a[N],tag[N],blg[N],L[N],R[N],bloc
阅读全文
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=5e4+5; 5 vector<ll>v[50005]; 6 ll a[N],tag[N],blg[N],L[N],R[N],
阅读全文
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=5e4+5; 5 int blg[N],L[N],R[N],tag[N],sum[N],a[N],block,tot; 6 v
阅读全文
摘要://POJ这题用map会TLE,自己造hash,而且要求最小的x;暴力枚举; 1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 #include<algorithm> 5 #include<map> 6 #include<vect
阅读全文
摘要:The Luckiest number Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10897 Accepted: 2769 Description Chinese people think of '8' as the luc
阅读全文
摘要:1 class Solution { 2 public: 3 const double eps=1e-6; 4 int isok(vector<int>& cards) 5 { 6 vector<double>dp[4][4]; 7 for(int i=0;i<4;i++)dp[i][i].push
阅读全文