10 2020 档案

摘要:class Deque{public: int a[maxn]; int pl=1,pr=0;}Deq;int a[maxn];int n,k;void solve(){ Deq.pl=1;Deq.pr=0; for(int i=1;i<=n;i++){ while(Deq.pr>=Deq.pl&& 阅读全文
posted @ 2020-10-19 16:56 yesuweiYYYY 阅读(114) 评论(0) 推荐(0)
摘要:map<string,ll>mapp;map<string,ll>::iterator it;for(it=mapp.begin();it!=mapp.end();it++){ if(it->second>0){ t=it->first; }} 阅读全文
posted @ 2020-10-15 15:23 yesuweiYYYY 阅读(172) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> #define N 39989 using namespace std; const int mod=39989; const int modd=1e9; struct Seg { double k,b; Seg(){} Seg(int x0,int 阅读全文
posted @ 2020-10-13 20:07 yesuweiYYYY 阅读(95) 评论(0) 推荐(0)
摘要:``` /* * 辛普森积分公式:sum(l,r)=( f(l)+f(r)+4*f((l+r)/2) ) * (r-l) / 6 * 解: 对 f 函数在 (l,r) 的积分可以用 以上函数拟合 * * 欲对 (l,r) 的一段函数积分并给出了精度要求 * 可以对此段区间,递归使用上述公式(以设置的 阅读全文
posted @ 2020-10-13 16:36 yesuweiYYYY 阅读(484) 评论(0) 推荐(0)
摘要:bool isP[Maxn]; long long Prime[Maxn],cnt=0; void GetPrime(){ for(long long i=1;i<Maxn;i++) isP[i]=1; isP[1]=0; for(long long i=2;i<Maxn;i++){ if(isP[ 阅读全文
posted @ 2020-10-13 16:33 yesuweiYYYY 阅读(79) 评论(0) 推荐(0)
摘要:vector<int>v; void init(){ sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); } int getid(int x){ return lower_bound(v.begin(),v.end 阅读全文
posted @ 2020-10-13 16:13 yesuweiYYYY 阅读(80) 评论(0) 推荐(0)
摘要:int ppo(int x,int p){ int t=x,res=1; while(p>0){ if(p&1)res=(res*t)%mod; t=(t*t)%mod; p>>=1; } return res%mod; } 阅读全文
posted @ 2020-10-13 16:10 yesuweiYYYY 阅读(68) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h>using namespace std;const int maxn=5e5+10;void in(int &x){ int y=1;char c=getchar();x=0; while(c<'0'||c>'9'){if(c=='-')y=-1;c=g 阅读全文
posted @ 2020-10-13 16:06 yesuweiYYYY 阅读(115) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; const int maxn=5e5+10; vector<int>g[maxn]; int head[maxn],tot; void add(int fr,int to){ g[fr].push_back(t 阅读全文
posted @ 2020-10-13 15:57 yesuweiYYYY 阅读(194) 评论(0) 推荐(0)
摘要:typedef struct P { double x,y; }P; /*bool cmp1(P a,P b)//在这里一定要注意 atan2函数y写在逗号前 返回的极角范围为-π~π { if(atan2(a.y,a.x)==atan2(b.y,b.x))return a.x<b.x; else 阅读全文
posted @ 2020-10-13 15:49 yesuweiYYYY 阅读(117) 评论(0) 推荐(0)
摘要:dp[2]; dp[n&1]=dp[(n+1)&1] 阅读全文
posted @ 2020-10-13 15:21 yesuweiYYYY 阅读(79) 评论(0) 推荐(0)
摘要:struct edge{ int u,v,value; bool operator < (const edge &t){ return value<t.value; }}e[maxn];int fath[maxn];int find(int x){ return x == fath[x] ? x : 阅读全文
posted @ 2020-10-13 15:18 yesuweiYYYY 阅读(150) 评论(0) 推荐(0)
摘要:long long sum[maxn*4],lazy[maxn*4];long long a[maxn];void PushUp(long long rt){sum[rt]=sum[rt<<1]+sum[rt<<1|1];}//重置当前节点(rt)的信息void PushDown(long long 阅读全文
posted @ 2020-10-13 14:40 yesuweiYYYY 阅读(105) 评论(0) 推荐(0)
摘要:选块翻译:ctrl+alt+f 缩进:tab 取消缩进:shift + tab 代码规范化:ctrl+alt+l 阅读全文
posted @ 2020-10-13 14:32 yesuweiYYYY 阅读(287) 评论(0) 推荐(0)
摘要:long long cnt=1; long long sum[maxn*150],lazy[maxn*150],Lnode[maxn*150],Rnode[maxn*150]; void PushUp(long long rt){sum[rt]=sum[Lnode[rt]]+sum[Rnode[rt 阅读全文
posted @ 2020-10-13 14:28 yesuweiYYYY 阅读(150) 评论(0) 推荐(0)
摘要:下面是ACM比赛中常用的几个库 #include<bits/stdc++.h> #include <iostream> #include <cstdio> #include <fstream> #include <algorithm> #include <cmath> #include <deque 阅读全文
posted @ 2020-10-13 14:22 yesuweiYYYY 阅读(95) 评论(0) 推荐(0)
摘要:这是一种在线性时间复杂度里求乘法逆元的方法 long long inv[maxn]; inv[1]=1; for(long long i=2;i<maxn;i++){ inv[i]=mod-((mod/i)*inv[mod%i])%mod;//此处保证为正 } 阅读全文
posted @ 2020-10-13 14:20 yesuweiYYYY 阅读(69) 评论(0) 推荐(0)
摘要:freopen("t.in","r",stdin); freopen("t2.out","w",stdout); 阅读全文
posted @ 2020-10-13 14:14 yesuweiYYYY 阅读(98) 评论(0) 推荐(0)
摘要:int f[maxn][30]; int depth[maxn]; void bfs(){//遍历 queue<int>q; q.push(s); depth[s]=1; f[s][0]=s; while (!q.empty()){ int u=q.front();q.pop(); for(int 阅读全文
posted @ 2020-10-12 10:38 yesuweiYYYY 阅读(108) 评论(0) 推荐(0)
摘要:stl 的set容器很好用,非常有必要掌握 // ascending red black tree // cross set_intersection difference set_difference union set_union multiset<int>st;//多重集 s.begin(); 阅读全文
posted @ 2020-10-12 10:37 yesuweiYYYY 阅读(112) 评论(0) 推荐(0)
摘要:void in(int &x){ int y=1;char c=getchar();x=0; while(c<'0'||c>'9'){if(c=='-')y=-1;c=getchar();} while(c<='9'&&c>='0'){ x=(x<<1)+(x<<3)+c-'0';c=getchar 阅读全文
posted @ 2020-10-12 10:25 yesuweiYYYY 阅读(96) 评论(0) 推荐(0)
摘要:int d[maxn];bool vis[maxn]; struct Edge{ int to,v; }; vector<Edge>g[maxn]; void spfa(){ deque<int>q; memset(d,0x3f,sizeof(d)); d[1]=0; q.push_back(1); 阅读全文
posted @ 2020-10-12 09:42 yesuweiYYYY 阅读(75) 评论(0) 推荐(0)
摘要:getline()可以用来处理大模拟的问题。 getline(cin,str,'\n'); 阅读全文
posted @ 2020-10-09 18:50 yesuweiYYYY 阅读(79) 评论(0) 推荐(0)
摘要:zwk线段树,即非递归的线段树。优点:常数小,代码短。缺点:貌似不太好处理区间修改的操作。代码: //建树 inline void Build(int n){ for(M=1;M<n;M<<=1);//找到M for(int i=M+1;i<=M+n;i++)cin>>d[i];//输入 for(i 阅读全文
posted @ 2020-10-09 18:38 yesuweiYYYY 阅读(345) 评论(0) 推荐(0)
摘要:山东大学数据库实验 2-1 create or replace view test2_01 as (select sid,name from pub.student where sid not in (select sid from pub.student_course) ) 2-2 create 阅读全文
posted @ 2020-10-07 22:04 yesuweiYYYY 阅读(520) 评论(0) 推荐(1)