随笔分类 - algotirhmBlueBridge
摘要:#include<iostream> #include<algorithm> #include<complex> using namespace std; using PDD=pair<double,double>; const int N=1e3+10; const double eps=1e-6
阅读全文
摘要:#include<iostream> #include<algorithm> #include<queue> #include<vector> using namespace std; using PII=pair<int,int>; const int N=5e4+10; int n,id[N];
阅读全文
摘要:#include<iostream> #include<algorithm> #include<map> #include<cstring> using namespace std; using PII=pair<int,int>; const int N=2e3+510; int n,m; PII
阅读全文
摘要:#include<iostream> #include<algorithm> using namespace std; using ll= long long; const int N=5e5+10; int n,m,ans; ll T,w[N],t[N],tmp[N]; ll sq(ll x){
阅读全文
摘要:#include<iostream> #include<algorithm> #include<cstring> #include<cstdlib> using namespace std; using ll = long long; const int N = 5e2 + 10; int n, m
阅读全文
摘要:#include<iostream> #include<algorithm> using namespace std; const int N= 5e5+3e3; using ll=long long ; ll n,m,i,j,k,a[N],b[N],cnt=0; void merge(ll a[]
阅读全文
摘要:code #include<iostream> #include<algorithm> #include<queue> #include<vector> #define fir(i,a,b) for(int i=a;i<=b;++i) using namespace std; priority_qu
阅读全文
摘要:code #include<iostream> #include<algorithm> using namespace std; const int N = 100010; typedef long long ll; ll res1,res2; int row[N],col[N],tmp[N]; i
阅读全文
摘要:code #include<iostream> #include<algorithm> using namespace std; const int N=1e5+10; int n,res=0; int a[N]; int main(){ ios::sync_with_stdio(false); c
阅读全文
摘要:code #include<iostream> #include<algorithm> using namespace std; int n, m, k, tot = 0; const int N = 2e5 + 50; //languige come from scientiet,audio an
阅读全文
摘要:code // Forward declaration of compare API. // bool compare(int a, int b); // return bool means whether a is less than b. class Solution { public: vec
阅读全文
摘要:code #include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; int cows[N]; double sum[N]; int n, m; bool check(double avg)
阅读全文
摘要:code #include<iostream> #include<algorithm> #include<set> using namespace std; const int N=1e4+10; set<pair<int,int>> existed; int n,p,h,m; int c[N],d
阅读全文
摘要:code #include<iostream> #include<algorithm> using namespace std; using ll=long long; const int N=110000; ll n,m,i,j,p,q,a[N]; //p为b序列中正数之和,而q为b序列中负数之和
阅读全文
摘要:Q A #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 5e3 + 10; int s[N][N]; int n, r; int main() { ios::syn
阅读全文
摘要:Q A #include<iostream> #include<complex> #include<iomanip> using namespace std; using LL = long long ; using PLL = pair<LL,LL>; PLL calc(LL n,LL m){ i
阅读全文
摘要:#include<iostream> using namespace std; #define Mod 9901 #define ll long long int a,b; int ksm(int a,int b){ int ans=1; a%=Mod; while(b){ if(b&1){ ans
阅读全文
摘要:Q 你玩过“拉灯”游戏吗? 25 盏灯排成一个 5×5 的方形。 每一个灯都有一个开关,游戏者可以改变它的状态。 每一步,游戏者可以改变某一个灯的状态。 游戏者改变一个灯的状态会产生连锁反应:和这个灯上下左右相邻的灯也要相应地改变其状态。 我们用数字 1 表示一盏开着的灯,用数字 0 表示关着的灯。
阅读全文
摘要:code #include<iostream> using namespace std; const int N=10; int path[N]; int state[N]; int n; void dfs(int u){ if(u>n){ for(int i=1;i<=n;++i){ cout<<
阅读全文
摘要:code #include<iostream> #include<algorithm> using namespace std; #define rep(i,a,b) for(int i=(a);i<=(b);++i) #define dwn(i,a,b) for(int i=(a);i>=(b);
阅读全文